aspose file tools*
The moose likes JDBC and the fly likes Eclipse + MySQL: Mountain Lion problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Eclipse + MySQL: Mountain Lion problem" Watch "Eclipse + MySQL: Mountain Lion problem" New topic
Author

Eclipse + MySQL: Mountain Lion problem

Maeve Duffy
Greenhorn

Joined: Feb 12, 2013
Posts: 3
I've searched every board I can think of (5+ days now) and still cannot find an answer. Help!

I'm not new to Java, or Eclipse, or MySQL, but I am new to OS X Mountain Lion. My husband upgraded my MacBook (at my request) to Mountain Lion last week. With Snow Leopard, my program ran just fine. It connected to MySQL straight off, no problems at all.

Here's a code snippet:

Class.forName("com.mysql.jdbc.Driver");
String url = "jdbc:mysql://localhost:3306/CountyFair";
dbConnection = DriverManager.getConnection(url, MYSQL_USER, MYSQL_PW);

And here is the error message:

sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown database 'countyfair'

I can run mysql from the command line, with that user, that password, and that database just fine. No problems at all. The database DOES EXIST.

Since getting this error, I've upgraded to mysql 5.6.10, mysql-connector 5.1.23, and eclipse 4.2.1. None of that has helped. I've tried using the actual ip instead of localhost. I've tried creating a new user and granting all privileges on *.* and on countyfair.* to that user. No luck. Any ideas?
Maeve Duffy
Greenhorn

Joined: Feb 12, 2013
Posts: 3
Update: after installing dtp on Eclipse, I was able to connect in db development, but couldn't see any tables. Still couldn't connect from the program. I had turned the firewall off days ago but hadn't rebooted, so I did that and now I the program connects but can't see anything in the db. No tables, no stored procs, no views.
Maeve Duffy
Greenhorn

Joined: Feb 12, 2013
Posts: 3
Fixed. Apparently rebooting after changing the security settings was the "real" answer. Who knew? That's not something I expect to have to do from a Mac. That's a windows hangup.

Also this post helped:
http://www.eclipse.org/forums/index.php/mv/msg/366810/894026/#msg_894026
 
jQuery in Action, 2nd edition
 
subject: Eclipse + MySQL: Mountain Lion problem