如何使用Oracle SQL Developer连接到MySQL数据库?

时间:2022-09-25 21:45:30

I have Oracle SQL Developer already installed and am able to connect to and query Oracle databases.

我已经安装了Oracle SQL Developer,并且能够连接和查询Oracle数据库。

Using Help -> Check for Updates I was able to install the Oracle MySQL Browser extension but there are no connection options for MySQL databases.

使用帮助->检查更新我可以安装Oracle MySQL浏览器扩展,但是没有连接MySQL数据库的选项。

7 个解决方案

#1


69  

Under Tools > Preferences > Databases there is a third party JDBC driver path that must be setup. Once the driver path is setup a separate 'MySQL' tab should appear on the New Connections dialog.

在工具>首选项>数据库中,有一个必须设置的第三方JDBC驱动程序路径。一旦驱动程序的路径设置为一个单独的“MySQL”选项卡应该出现在新的连接对话框。

Note: This is the same jdbc connector that is available as a JAR download from the MySQL website.

注意:这是同一个jdbc连接器,可以从MySQL网站上下载。

#2


18  

In fact you should do both :

事实上,你应该同时做两件事:


  1. Add driver

    添加驱动程序

    • Download driver https://maven.atlassian.com/content/groups/public/mysql/mysql-connector-java/5.1.29/
    • 下载驱动程序https://maven.atlassian.com/content/groups/public/mysql/mysql-connector-java/5.1.29/
    • To add this driver :
    • 要添加这个驱动程序:
    • In Oracle SQL Developper > Tools > Preferences... > Database > Third Party JDBC Drivers > Add Entry...
    • 在Oracle SQL开发的>工具>首选项…>数据库>第三方JDBC驱动程序>添加条目…
    • Select previously downloaded mysql connector jar file.
    • 选择之前下载的mysql连接器jar文件。
  2. Add Oracle SQL developper connector

    添加Oracle SQL开发的连接器。

    • In Oracle SQL Developper > Help > Check for updates > Next
    • 在Oracle SQL开发中>帮助>检查更新>。
    • Check All > Next
    • 检查所有>下
    • Filter on "mysql"
    • 过滤“mysql”
    • Check All > Finish
    • 检查所有>完成
  3. Next time you will add a connection, MySQL new tab is available !

    下一次你将添加一个连接,MySQL新标签可用!

#3


8  

Here is a demo on How to Create a Database Connection for MySQL.

下面是关于如何为MySQL创建数据库连接的演示。

You can download the MySQL Connector/J from here.

您可以从这里下载MySQL连接器/J。

#4


6  

Here's another extremely detailed walkthrough that also shows you the entire process, including what values to put in the connection dialogue after the JDBC driver is installed: http://rpbouman.blogspot.com/2007/01/oracle-sql-developer-11-supports-mysql.html

这里还有另外一个非常详细的介绍,它还向您展示了整个过程,包括在JDBC驱动程序安装之后,在连接对话中放入哪些值:http://rpbouman.blogspot.com/2007/01/oracle-sql-developer-11-supports-mysql.html。

#5


1  

My experience with windows client and linux/mysql server:

我的windows客户端和linux/mysql服务器的经验:

When sqldev is used in a windows client and mysql is installed in a linux server meaning, sqldev network access to mysql.

当sqldev在windows客户端中使用时,mysql安装在linux服务器上,这意味着sqldev可以访问mysql。

Assuming mysql is already up and running and the databases to be accessed are up and functional:

假设mysql已经启动并且正在运行,并且访问的数据库是向上和实用的:

• Ensure the version of sqldev (32 or 64). If 64 and to avoid dealing with path access copy a valid 64 version of msvcr100.dll into directory ~\sqldeveloper\jdev\bin.

•确保sqldev(32或64)的版本。如果64和避免处理路径访问复制一个有效的64版本msvcr100。dll ~ \ sqldeveloper \ jdev \ bin目录。

a. Open the file msvcr100.dll in notepad and search for first occurrence of “PE “

打开文件msvcr100。在记事本中的dll并搜索“PE”的首次出现

 i. “PE  d” it is 64.

ii. “PE  L” it is 32.

b. Note: if sqldev is 64 and msvcr100.dll is 32, the application gets stuck at startup.

注意:如果sqldev是64和msvcr100。dll是32,应用程序在启动时卡住。

• For sqldev to work with mysql there is need of the JDBC jar driver. Download it from mysql site.

•对于sqldev来说,要使用mysql,需要JDBC jar驱动程序。从mysql网站下载。

a. Driver name = mysql-connector-java-x.x.xx

a.驱动器名= mysql-connector-java-x.x.xx。

b. Copy it into someplace related to your sqldeveloper directory.

把它复制到与你的sqldeveloper目录相关的地方。

c. Set it up in menu sqldev Tools/Preferences/Database/Third Party JDBC Driver (add entry)

c.设置在菜单sqldev工具/首选项/数据库/第三方JDBC驱动程序(添加条目)

• In Linux/mysql server change file /etc/mysql/mysql.conf.d/mysqld.cnf look for

•在Linux/mysql服务器更改文件/etc/ mysql/mysql/mysql/mysql/mysql/mysqld.cnf查找。

bind-address = 127.0.0.1 (this linux localhost)

bind-address = 127.0.0.1(此linux localhost)

and change to

和改变

bind-address = xxx.xxx.xxx.xxx (this linux server real IP or machine name if DNS is up)

bind-address = xxx.xxx.xxx。xxx(此linux服务器的真实IP或机器名称,如果DNS是up)

• Enter to linux mysql and grant needed access for example

•进入linux mysql,并授予所需的访问权限。

# mysql –u root -p

# mysql -u root -p。

GRANT ALL ON . to root@'yourWindowsClientComputerName' IDENTIFIED BY 'mysqlPasswd';

授予所有。用“mysqlPasswd”标识的“yourWindowsClientComputerName”;

flush privileges;

冲洗特权;

restart mysql - sudo /etc/init.d/mysql restart

重启mysql - sudo / etc/init。d / mysql重启

• Start sqldev and create a new connection

•启动sqldev并创建一个新的连接。

a. user = root

答:用户=根

b. pass = (your mysql pass)

b. pass =(你的mysql通行证)

c. Choose MySql tab

c。选择MySql选项卡

 i.   Hostname = the linux IP hostname

 ii.  Port     = 3306 (default for mysql)

 iii. Choose Database = (from pull down the mysql database you want to use)

 iv.  save and connect

That is all I had to do in my case.

这就是我所要做的。

Thank you,

谢谢你!

Ale

啤酒

#6


0  

You may find the following relevant as well:

你也可以找到以下相关信息:

Oracle SQL Developer connection to Microsoft SQL Server

Oracle SQL开发人员连接到Microsoft SQL Server。

In my case I had to place the ntlmauth.dll in the sql-developer application directory itself (i.e. sql-developer\jdk\jre\bin). Why this location over the system jre/bin I have no idea. But it worked.

在我的例子中,我必须放置ntlmauth。在sql开发应用程序目录本身(即sql-developer\jdk\jre\bin)中使用dll。为什么这个位置在系统jre/bin我不知道。但是,它的工作。

#7


0  

Although @BrianHart 's answer is correct, if you are connecting from a remote host, you'll also need to allow remote hosts to connect to the MySQL/MariaDB database.

虽然@BrianHart的回答是正确的,但是如果您从远程主机连接,您还需要允许远程主机连接到MySQL/MariaDB数据库。

My article describes the full instructions to connect to a MySQL/MariaDB database in Oracle SQL Developer:

我的文章描述了在Oracle SQL Developer中连接到MySQL/MariaDB数据库的完整说明:

https://alvinbunk.wordpress.com/2017/06/29/using-oracle-sql-developer-to-connect-to-mysqlmariadb-databases/

https://alvinbunk.wordpress.com/2017/06/29/using-oracle-sql-developer-to-connect-to-mysqlmariadb-databases/

#1


69  

Under Tools > Preferences > Databases there is a third party JDBC driver path that must be setup. Once the driver path is setup a separate 'MySQL' tab should appear on the New Connections dialog.

在工具>首选项>数据库中,有一个必须设置的第三方JDBC驱动程序路径。一旦驱动程序的路径设置为一个单独的“MySQL”选项卡应该出现在新的连接对话框。

Note: This is the same jdbc connector that is available as a JAR download from the MySQL website.

注意:这是同一个jdbc连接器,可以从MySQL网站上下载。

#2


18  

In fact you should do both :

事实上,你应该同时做两件事:


  1. Add driver

    添加驱动程序

    • Download driver https://maven.atlassian.com/content/groups/public/mysql/mysql-connector-java/5.1.29/
    • 下载驱动程序https://maven.atlassian.com/content/groups/public/mysql/mysql-connector-java/5.1.29/
    • To add this driver :
    • 要添加这个驱动程序:
    • In Oracle SQL Developper > Tools > Preferences... > Database > Third Party JDBC Drivers > Add Entry...
    • 在Oracle SQL开发的>工具>首选项…>数据库>第三方JDBC驱动程序>添加条目…
    • Select previously downloaded mysql connector jar file.
    • 选择之前下载的mysql连接器jar文件。
  2. Add Oracle SQL developper connector

    添加Oracle SQL开发的连接器。

    • In Oracle SQL Developper > Help > Check for updates > Next
    • 在Oracle SQL开发中>帮助>检查更新>。
    • Check All > Next
    • 检查所有>下
    • Filter on "mysql"
    • 过滤“mysql”
    • Check All > Finish
    • 检查所有>完成
  3. Next time you will add a connection, MySQL new tab is available !

    下一次你将添加一个连接,MySQL新标签可用!

#3


8  

Here is a demo on How to Create a Database Connection for MySQL.

下面是关于如何为MySQL创建数据库连接的演示。

You can download the MySQL Connector/J from here.

您可以从这里下载MySQL连接器/J。

#4


6  

Here's another extremely detailed walkthrough that also shows you the entire process, including what values to put in the connection dialogue after the JDBC driver is installed: http://rpbouman.blogspot.com/2007/01/oracle-sql-developer-11-supports-mysql.html

这里还有另外一个非常详细的介绍,它还向您展示了整个过程,包括在JDBC驱动程序安装之后,在连接对话中放入哪些值:http://rpbouman.blogspot.com/2007/01/oracle-sql-developer-11-supports-mysql.html。

#5


1  

My experience with windows client and linux/mysql server:

我的windows客户端和linux/mysql服务器的经验:

When sqldev is used in a windows client and mysql is installed in a linux server meaning, sqldev network access to mysql.

当sqldev在windows客户端中使用时,mysql安装在linux服务器上,这意味着sqldev可以访问mysql。

Assuming mysql is already up and running and the databases to be accessed are up and functional:

假设mysql已经启动并且正在运行,并且访问的数据库是向上和实用的:

• Ensure the version of sqldev (32 or 64). If 64 and to avoid dealing with path access copy a valid 64 version of msvcr100.dll into directory ~\sqldeveloper\jdev\bin.

•确保sqldev(32或64)的版本。如果64和避免处理路径访问复制一个有效的64版本msvcr100。dll ~ \ sqldeveloper \ jdev \ bin目录。

a. Open the file msvcr100.dll in notepad and search for first occurrence of “PE “

打开文件msvcr100。在记事本中的dll并搜索“PE”的首次出现

 i. “PE  d” it is 64.

ii. “PE  L” it is 32.

b. Note: if sqldev is 64 and msvcr100.dll is 32, the application gets stuck at startup.

注意:如果sqldev是64和msvcr100。dll是32,应用程序在启动时卡住。

• For sqldev to work with mysql there is need of the JDBC jar driver. Download it from mysql site.

•对于sqldev来说,要使用mysql,需要JDBC jar驱动程序。从mysql网站下载。

a. Driver name = mysql-connector-java-x.x.xx

a.驱动器名= mysql-connector-java-x.x.xx。

b. Copy it into someplace related to your sqldeveloper directory.

把它复制到与你的sqldeveloper目录相关的地方。

c. Set it up in menu sqldev Tools/Preferences/Database/Third Party JDBC Driver (add entry)

c.设置在菜单sqldev工具/首选项/数据库/第三方JDBC驱动程序(添加条目)

• In Linux/mysql server change file /etc/mysql/mysql.conf.d/mysqld.cnf look for

•在Linux/mysql服务器更改文件/etc/ mysql/mysql/mysql/mysql/mysql/mysqld.cnf查找。

bind-address = 127.0.0.1 (this linux localhost)

bind-address = 127.0.0.1(此linux localhost)

and change to

和改变

bind-address = xxx.xxx.xxx.xxx (this linux server real IP or machine name if DNS is up)

bind-address = xxx.xxx.xxx。xxx(此linux服务器的真实IP或机器名称,如果DNS是up)

• Enter to linux mysql and grant needed access for example

•进入linux mysql,并授予所需的访问权限。

# mysql –u root -p

# mysql -u root -p。

GRANT ALL ON . to root@'yourWindowsClientComputerName' IDENTIFIED BY 'mysqlPasswd';

授予所有。用“mysqlPasswd”标识的“yourWindowsClientComputerName”;

flush privileges;

冲洗特权;

restart mysql - sudo /etc/init.d/mysql restart

重启mysql - sudo / etc/init。d / mysql重启

• Start sqldev and create a new connection

•启动sqldev并创建一个新的连接。

a. user = root

答:用户=根

b. pass = (your mysql pass)

b. pass =(你的mysql通行证)

c. Choose MySql tab

c。选择MySql选项卡

 i.   Hostname = the linux IP hostname

 ii.  Port     = 3306 (default for mysql)

 iii. Choose Database = (from pull down the mysql database you want to use)

 iv.  save and connect

That is all I had to do in my case.

这就是我所要做的。

Thank you,

谢谢你!

Ale

啤酒

#6


0  

You may find the following relevant as well:

你也可以找到以下相关信息:

Oracle SQL Developer connection to Microsoft SQL Server

Oracle SQL开发人员连接到Microsoft SQL Server。

In my case I had to place the ntlmauth.dll in the sql-developer application directory itself (i.e. sql-developer\jdk\jre\bin). Why this location over the system jre/bin I have no idea. But it worked.

在我的例子中,我必须放置ntlmauth。在sql开发应用程序目录本身(即sql-developer\jdk\jre\bin)中使用dll。为什么这个位置在系统jre/bin我不知道。但是,它的工作。

#7


0  

Although @BrianHart 's answer is correct, if you are connecting from a remote host, you'll also need to allow remote hosts to connect to the MySQL/MariaDB database.

虽然@BrianHart的回答是正确的,但是如果您从远程主机连接,您还需要允许远程主机连接到MySQL/MariaDB数据库。

My article describes the full instructions to connect to a MySQL/MariaDB database in Oracle SQL Developer:

我的文章描述了在Oracle SQL Developer中连接到MySQL/MariaDB数据库的完整说明:

https://alvinbunk.wordpress.com/2017/06/29/using-oracle-sql-developer-to-connect-to-mysqlmariadb-databases/

https://alvinbunk.wordpress.com/2017/06/29/using-oracle-sql-developer-to-connect-to-mysqlmariadb-databases/