Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

cannot connect to MySQL server over the internet

843859Feb 8 2007 — edited Feb 8 2007
hi,

i can connect to the MySQL server on another machine in my lan perfectly in the same network.

but when i try to connect via the internet it won't connect :(
this is the code that i use (that works perfectly when i use the local ip)

String userName = "me"
String password = "something";
String url = "jdbc:mysql://xx.xx.xx.xx:3306/fileserver";
Class.forName ("com.mysql.jdbc.Driver").newInstance ();
conn = DriverManager.getConnection (url, userName, password);
System.out.println ("Database connection established");

port 3306 is forwarded in the router to the right pc because when I try:
telnet xx.xx.xx.xx 3306 i get the following message:

Trying xx.xx.xx.xx...
Connected to xx.xx.xx.xx.
Escape character is '^]'.
Host 'something.access.telenet.be' is not allowed to connect to this MySQL serverConnection closed by foreign host.

what could be the problem??
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 8 2007
Added on Feb 8 2007
2 comments
163 views