Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Error from MySql

 
muthu muruges
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
java.sql.SQLException: Data source rejected establishment of connection, message from server: "Host '10.200.16.237' is not allowed to connect to this MySQL server"

I am getting the above error when I am trying to access the MySql database which is running in a linux machine. My JDBC code is running in windows 2K machine. Mine is an application only not an applet.

Please let me know how to solve this problem.
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 35976
422
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Muthu,
Do you have a firewall on the linux box?
 
muthu muruges
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the update.

I solved the problem thru' privileges setup in mysql.

The query is:
grant all privileges on *.* to '<username>'@'%' with grant option;

Here the '%' means that mysql allows connection from any host.
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 35976
422
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Interesting. Thanks for posting the solution.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!