-2

I'm trying to connect my Java program to my server but I can't. I don't want to use a localhost.

JAL
  • 41,701
  • 23
  • 172
  • 300

1 Answers1

0

Use the hostname of the mysql server in the connection string instead of using localhost. Make sure port 3306 is open on the mysql machine. If you don't have a hostname use the IP address as a lassssst resort. E.g.

192.168.1.20:3306

http://dev.mysql.com/doc/connector-j/en/connector-j-installing.html

Bob
  • 780
  • 9
  • 10