How to Connect MySql from Eclipse using Data Source Explorer

16.6k views Asked by At

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".


How can I specify a Driver Template and Definition Name under New Driver Definition dialog of Data Source Explorer (in Data Tools Platform)

2

There are 2 answers

14
Fredrick Gauss On

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:

  • Connection URL: jdbc:mysql://localhost:3306
  • Database Name: MyDatabaseNameHere
  • Driver Class: com.mysql.jdbc.Driver
  • Password: MyPasswordHere
  • User ID: root

In the end, OK butten changed to enabled and that is all.

0
Binoy S Kumar On

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.