Can't register MySQL JDBC driver with Idea
Hi,
I am fairly new to Idea and right now trying to create a new project using Hibernate over MySQL DB. Idea just popped up a dialog window prompting me to create a data source so that Idea can discover the database schema. I supplied the path to the JAR containing the DB driver that I downloaded from MySQl website (mysql-connector-java-5.1.6-bin.jar), and Idea was able to find all the driver classes contained in it correctly and populate the list.
Nevertheless as soon as I select the driver from the list (com.mysql.jdbc.Driver) and hit OK the error pop-up appears bearing the following message: "Incorrect driver and/or connection settings specified, do you want to save the data source anyway?"
I am positive that the user name and password for the DB are correct.
Could you please help to clear out the problem? I sense t must be something simple.
Thanks in advance,
Dmitry
Please sign in to leave a comment.
Hello Dmitry,
What IDEA build are you using?
If the following conditions are all true, everything should be Ok:
1. Database URL is correct.
2. Driver class is correct.
3. User name and password are correct.
4. Database is running.
Alexander.
Hi Alexander,
Thanks for your quick reply.
I am using Idea 7.0.3. Build #7757 of 12.03.2008.
The MySQL instance is running, I can log into it with a command line client. Everything is on localhost, so possibility of making mistake is minimal.
Still can't create a data source...
Are there any reports of faulty drivers?
Dmitry
Hello Dmitry,
I can find only this one: http://www.jetbrains.net/jira/browse/IDEADEV-22176
But it is fixed long before 7757, and in 7757 all cases work fine for me.
Alexander.
Dmitry,
Did you ever figure this out? I'm on IntelliJ 9.0 and Mac 10.6.2 (clean install, just downloaded it) and having exactly the same problem -- I thought it might be permissions and have installed/unzipped MySQL Connector/J driver in every way I can think of:
* MacPorts package
* tar.gz from mysql site
* zip from an alternative mysql mirror
All unzipped under my downloads directory (except MacPorts which installed it under a diff directory).
I edited the log.xml file in the IntelliJ 9.app contents to turn the logging to TRACE and got no information pertaining to the connection failure -- like an exception or something.
I've tried version 5.0 and 5.1.10 (latest GA) of the Connector/J driver with no luck -- using the MySQL Workshop (native MySQL admin gui) with the same credentials:
http://localhost:3306 -- root, no password
works fine, I can rev-eng the tables into a nice diagram. Typing ANY values (including the right ones) into the connect dialog in IntelliJ 9.0 on my Mac results in the damnable popup: "Incorrect driver and/or connection setting specified."
Screenshot attached showing the MySQL Workbench settings and test results vs IntelliJ 9.
NOTE -- I'm running a standard IntelliJ 9 install -- I haven't tweaked it to run with the 64-bit JVM or anything like that.
NOTE -- I've also included my log just incase I missed an important detail. Default logging settings for this one and cleaned out before the last run.
Attachment(s):
idea.log.zip
mysql-workbench-vs-intellij9.png
From the attached picture, your connection url looks incorrect.
From the mysql jdbc connector manual:
So your missing the mysql: bit?
You are a wonderful person -- I guess I looked at that connection string for so long that my brain thought it was seeing the correct string -- you were right, I was missing the "mysql:" bit.