Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

I can't connect to my local MySQL machine!

 
Timothy Sam
Ranch Hand
Posts: 751
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This might seem to you like more of a mysql question than a java question... But I'm asking it anyway...

I'm getting this error in tomcat logs...


java.sql.SQLException: null, message from server: "Host 'leila' is not allowed to connect to this MySQL server"


I'm on a WindowsXP SP2 machine... I've made exception for my sql port in my firewall... I've used SET PASSWORD FOR ''@'localhost' = PASSWORD('newpwd'); and UPDATE mysql.user SET Password = PASSWORD('newpwd') but still get this error... I don't understand... I'm just running from a local machine and I myself is not allowed to connect?
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when you refer to your database, do you call it 'localhost' or by machine name? I'm guessing your jdbc url has the machine name.

the quick fix is to change this to 'localhost', the other option is to allow that user to connect from the 'remote' location, ie the external IP of you machine.

Dave
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Instructions on how to allow 'remote' logins to MySQL cxan be found in this thread.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic