如何使用 Oracle SQL Developer 连接到 MySQL 数据库?
我已经安装了 Oracle SQL Developer,并且能够连接和查询 Oracle 数据库。
使用帮助-> 检查更新 我能够安装 Oracle MySQL 浏览器扩展,但没有 MySQL 数据库的连接选项。
I have Oracle SQL Developer already installed and am able to connect to and query Oracle databases.
Using Help -> Check for Updates I was able to install the Oracle MySQL Browser extension but there are no connection options for MySQL databases.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
我使用windows客户端和linux/mysql服务器的经验:
当在windows客户端中使用sqldev并且mysql安装在linux服务器中时,sqldev通过网络访问mysql。
假设mysql 已启动并正在运行,并且要访问的数据库已启动并正常工作:
• 确保sqldev 的版本(32 或64)。 如果是 64,为了避免处理路径访问,请将有效的 64 版本的 msvcr100.dll 复制到目录 ~\sqldeveloper\jdev\bin 中。
A。 在记事本中打开文件 msvcr100.dll 并搜索第一次出现的“PE”
b。 注意:如果 sqldev 为 64 并且 msvcr100.dll 为 32,则应用程序在启动时会卡住。
• 为了让sqldev 与mysql 一起工作,需要JDBC jar 驱动程序。 从 mysql 站点下载它。
A。 驱动程序名称 = mysql-connector-java-
xxxx 将其复制到与 sqldeveloper 目录相关的某个位置。
C。 在菜单 sqldev Tools/Preferences/Database/Third Party JDBC Driver 中设置(添加条目)
• 在 Linux/mysql 服务器中更改文件 /etc/mysql/mysql.conf.d/mysqld.cnf
查找
bind-address = 127.0.0.1(此linux localhost)
并更改为
bind-address = xxx.xxx.xxx.xxx(此linux服务器真实IP或机器名,如果DNS已启动)
• 输入linux mysql并需要授予权限例如,访问
# mysql –u root -p
GRANT ALL ON . to root@'yourWindowsClientComputerName' IDENTIFIED BY 'mysqlPasswd';
冲洗特权;
重新启动 mysql - sudo /etc/init.d/mysql restart
并创建新连接
• 启动sqldev 用户 = root
B. pass = (你的mysql pass)
c. 选择 MySql 选项卡
这就是我在我的例子中所要做的。
谢谢你,
艾尔
My experience with windows client and linux/mysql server:
When sqldev is used in a windows client and mysql is installed in a linux server meaning, sqldev network access to mysql.
Assuming mysql is already up and running and the databases to be accessed are up and functional:
• 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.
a. Open the file msvcr100.dll in notepad and search for first occurrence of “PE “
b. Note: if sqldev is 64 and msvcr100.dll is 32, the application gets stuck at startup.
• For sqldev to work with mysql there is need of the JDBC jar driver. Download it from mysql site.
a. Driver name = mysql-connector-java-x.x.xx
b. Copy it into someplace related to your sqldeveloper directory.
c. Set it up in menu sqldev Tools/Preferences/Database/Third Party JDBC Driver (add entry)
• In Linux/mysql server change file /etc/mysql/mysql.conf.d/mysqld.cnf
look for
bind-address = 127.0.0.1 (this linux localhost)
and change to
bind-address = xxx.xxx.xxx.xxx (this linux server real IP or machine name if DNS is up)
• Enter to linux mysql and grant needed access for example
# mysql –u root -p
GRANT ALL ON . to root@'yourWindowsClientComputerName' IDENTIFIED BY 'mysqlPasswd';
flush privileges;
restart mysql - sudo /etc/init.d/mysql restart
• Start sqldev and create a new connection
a. user = root
b. pass = (your mysql pass)
c. Choose MySql tab
That is all I had to do in my case.
Thank you,
Ale
这是另一个非常详细的演练,它还向您展示了整个过程,包括安装 JDBC 驱动程序后要在连接对话中放入哪些值: http://rpbouman.blogspot.com/2007/01/oracle-sql-developer-11-supports-mysql.html
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
事实上,您应该同时执行这两项操作:
添加驱动程序
添加 Oracle SQL 开发人员连接器
下次您添加连接时,MySQL新选项卡可用!
In fact you should do both :
Add driver
Add Oracle SQL developper connector
Next time you will add a connection, MySQL new tab is available !
您可能还会发现以下相关内容:
Oracle SQL Developer与 Microsoft SQL Server 的连接
在我的例子中,我必须将
ntlmauth.dll
放在 sql-developer 应用程序目录本身中(即 sql-developer\jdk\jre\bin)。 我不知道为什么这个位置位于系统 jre/bin 上。 但它奏效了。You may find the following relevant as well:
Oracle SQL Developer connection to 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.尽管 @BrianHart 的答案是正确的,但如果您从远程主机连接,则还需要允许远程主机连接到 MySQL/MariaDB 数据库。
我的文章介绍了在 Oracle SQL Developer 中连接到 MySQL/MariaDB 数据库的完整说明:
https://alvinbunk.wordpress.com/2017/06/29/using-oracle-sql-developer-to-connect-to-mysqlmariadb-databases/
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.
My article describes the full instructions to connect to a MySQL/MariaDB database in Oracle SQL Developer:
https://alvinbunk.wordpress.com/2017/06/29/using-oracle-sql-developer-to-connect-to-mysqlmariadb-databases/
在工具>下 首选项> 数据库必须设置第三方 JDBC 驱动程序路径。 一旦设置了驱动程序路径,“新建连接”对话框中就会出现一个单独的“MySQL”选项卡。
注意:这与可从 MySQL 网站以 JAR 下载形式提供的 jdbc 连接器相同。
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.
Note: This is the same jdbc connector that is available as a JAR download from the MySQL website.