简体   繁体   English

Knime与数据库

[英]Knime with database

How to add new driver into database through KNIME preferences? 如何通过KNIME首选项将新驱动程序添加到数据库中? Generally, 通常,

File-> Preferences -> Add File/ Add Directory

The files accepted are only of *.jar or *.zip . 接受的文件仅是*.jar*.zip

MY QUESTION 我的问题

I have installed ODBC64 into my PC. 我已经在计算机上安装了ODBC64 Now I need to add that file into knime preferences and use the Driver into Database Connector node. 现在,我需要将该文件添加到knime首选项中,并使用“驱动程序插入数据库连接器”节点。

  • How to add and use the file into my Knime? 如何在我的Knime中添加和使用文件?
  • And What is meant by Database URL jdbc:mysql://host:port/database_name 和什么是数据库URL jdbc:mysql://host:port/database_name
    Host and port? 主机和端口?

Can anyone please briefly explain and help me out? 谁能简要解释一下并帮助我?

I'm assuming based on your database URL of jdbc:mysql:// that you are wanting to connect to a MySQL database? 我假设基于jdbc:mysql://的数据库URL,您想连接到MySQL数据库? Based on that, then there is a thread on the KNIME forum which explains pretty much all of your question, but the process is the same for any other sort of database. 基于此,然后在KNIME论坛上有一个线程可以解释您几乎所有的问题,但是对于任何其他类型的数据库,该过程都是相同的。 The steps are as follows: 步骤如下:

  1. Download the jdbc driver (eg from https://dev.mysql.com/downloads/connector/j/ for MySQL) - NB KNIME now comes bundled with several drivers already installed - MySQL is one of those - in the Database Connector node the drivers installed are listed. 下载jdbc驱动程序(例如从MySQL的https://dev.mysql.com/downloads/connector/j/下载)-NB KNIME现在捆绑了已经安装的几个驱动程序-MySQL是其中之一-在“数据库连接器”节点中,列出已安装的驱动程序。

  2. In the database URL, you need to change those parts in <> - ie the hostname, port number and database name. 在数据库URL中,您需要在<>更改这些部分-即主机名,端口号和数据库名。 Hostname may be localhost if it is a local database. 如果主机名是本地数据库,则主机名可以是localhost。 The port number you will need to find from your database administrator, or will be what you set it up to be if you are running a local database (3306 is the default for MySQL), so for a database called 'myDB' on the default port on your local machine, the url should be jdbc:mysql://localhost:3306/myDB 您需要从数据库管理员那里找到端口号,或者如果您运行的是本地数据库,则该端口号将被设置为该端口号(MySQL默认为3306),因此默认情况下名为“ myDB”的数据库本地计算机上的端口,URL应为jdbc:mysql://localhost:3306/myDB

For some of the shipped drivers, there are also connector nodes, eg MySQL Connector, SQLite Connector, PostgreSQL Connector etc, which still require the server name/port and database name, but take them as individual inputs rather than requiring editing of the URL 对于某些附带的驱动程序,还有连接器节点,例如MySQL连接器,SQLite连接器,PostgreSQL连接器等,它们仍然需要服务器名称/端口和数据库名称,但是将它们作为单独的输入而不需要编辑URL。

KNIME的最新版本基于Java 8,该版本放弃了对ODBC的支持 ,因此,只有在您可以按照数据库连接器KNIME文档页面上的说明使用KNIME连接该数据库之后,才应该首先找到数据库的替代驱动程序。

You have several nodes which allow you to connect to a DB (especially MySQL). 您有几个节点可以连接到数据库(尤其是MySQL)。 I remember there was a dedicated MySQL node for connecting with the DB. 我记得有一个专用的MySQL节点用于与数据库连接。 Just remember this: you have to input the IP adress : port, then insert credentials and point to the DB you want to open by default. 只需记住这一点:您必须输入IP地址:端口,然后插入凭据并指向默认情况下要打开的数据库。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM