如何使用数据源资源管理器从 Eclipse 连接 MySql
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/31934135/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to Connect MySql from Eclipse using Data Source Explorer
提问by DurgaPrasad Ravula
I need help. Could you please answer these question? I would like to connect eclipse to my database and I have tried these in eclipse: Window>Show View>Other>Data Source Explorer
. After that we get Database Connections
under the eclipse and then right click on the database connection and click on New...
then select MySql
under Connection Profile Types:
and I click on New Driver Definition
. Under New Driver Definition
dialog, there exists MySql JDBC Driver
with specific System Version. I choose one, but the OK
button is disabled. Also at the top it says: "Unable to locate JAR/zip in file system as specified by the driver definition: mysql-connector-java-xxx-bin.jar".
我需要帮助。你能回答这些问题吗?我想将 eclipse 连接到我的数据库,并且我在 eclipse 中尝试了这些:Window>Show View>Other>Data Source Explorer
. 之后我们进入Database Connections
eclipse下然后右键单击数据库连接然后单击New...
然后选择MySql
下Connection Profile Types:
我单击New Driver Definition
。在New Driver Definition
对话框下,存在MySql JDBC Driver
特定的系统版本。我选择了一个,但该OK
按钮被禁用。同样在顶部它说:“无法在驱动程序定义中指定的文件系统中找到 JAR/zip:mysql-connector-java-xxx-bin.jar”。
How can I specify a Driver Template and Definition Name under New Driver Definition
dialog of Data Source Explorer (in Data Tools Platform)
如何在New Driver Definition
数据源资源管理器的对话框下指定驱动程序模板和定义名称(在数据工具平台中)
回答by Fredrick Gauss
I dont know your Eclipse version or your MySql server version but for Kepler
and mysql 5.5 server
, here what I did. First I downloaded mysql connector java jar file(mysql-connector-java-5.1.36-bin.jar) from http://dev.mysql.com/downloads. Then On the New Driver Definition
dialog page, I choose MySQL JDBC Driver|MySQL|5.1
under Name/Type
tag. Go to JAR List
tab Clear all
and Add JAR/Zip...
and choosed my already downloaded jar file. Finally at the Properties
tab I filled them like this:
我不知道您的 Eclipse 版本或您的 MySql 服务器版本,但对于Kepler
and mysql 5.5 server
,我在这里做了什么。首先,我从http://dev.mysql.com/downloads下载了 mysql 连接器 java jar 文件(mysql-connector-java-5.1.36-bin.jar)。然后在对话框页面上,我选择标签下。转到选项卡并选择我已经下载的 jar 文件。最后在选项卡上,我像这样填充它们:New Driver Definition
MySQL JDBC Driver|MySQL|5.1
Name/Type
JAR List
Clear all
Add JAR/Zip...
Properties
- Connection URL:
jdbc:mysql://localhost:3306
- Database Name:
MyDatabaseNameHere
- Driver Class:
com.mysql.jdbc.Driver
- Password:
MyPasswordHere
- User ID:
root
- 连接网址:
jdbc:mysql://localhost:3306
- 数据库名称:
MyDatabaseNameHere
- 驱动程序类:
com.mysql.jdbc.Driver
- 密码:
MyPasswordHere
- 用户名:
root
In the end, OK
butten changed to enabled and that is all.
最后,OK
butten 更改为 enabled ,仅此而已。
回答by Binoy S Kumar
I also faced same issue. Just download the specific mysql JAR file needed. Now you need to add it to the JAR files tab. But before doing it click on clear all. That is the important step.
我也面临同样的问题。只需下载所需的特定 mysql JAR 文件。现在您需要将它添加到 JAR 文件选项卡。但在做之前点击清除所有。这是重要的一步。