• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Eclipse + MySQL: Mountain Lion problem

 
Maeve Duffy
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic