File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

mysql remote connection

 
kev james
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I'm having a problem using an ip address to connect to my mysql database. If i connect using localhost like below it works great, however if i use my ip address as shown below as well, it cant connect.
Thanks for the help
//conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/superconnect");
conn=DriverManager.getConnection("jdbc:mysql://10.161.43.72:3306/superconnect");
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you granted the remote IP permission to connect?
I'll go double check the syntax, but you have to execute the following on the database first:
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
more or less correct, except that you may require quotes around some stuff like the password, and you may also have to grant on <database> and <database>.*
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic