Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Connect MySql from Eclipse using Data Source Explorer

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)

like image 498
DurgaPrasad Ravula Avatar asked Dec 11 '22 21:12

DurgaPrasad Ravula


1 Answers

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.

like image 183
Fredrick Gauss Avatar answered Mar 02 '23 19:03

Fredrick Gauss