I have a problem connecting to MySQL remotely. I believe I have configured JDBC correctly i.e. extracting the mysql*.jar and setting the enviroment variables for the path.
I can connect to a MySQL database that is on the same machine (Windows XP) as the code I'm executing, however, I wish to conenct to a remote database on a server. I am using the following code to connect to it.
where "12.123.123.123" is the ip address of the server I am trying to connect to. I have tried accessing two different servers running MySQL - a Red Hat Liniux Enterprise 3 Server and a Fedora Core 4 Server and get the same result. I have even tried specifying the port number in the code eg:
Can anyone help me with this problem, I'm not really sure where the problem lies. It could be in the code as I'm new to connecting to MySQL with Java, or whether it is a firewall problem on the server.
Please help, cheers.
11-10-2005, 07:33 AM
munki020
Never mind, problem solved. If anyone else is having this problem, you must grant access to the IP address in mysql. eg:
GRANT ALL PRIVILEGES ON *.* TO 'user'@'12.345.678.90' IDENTIFIED BY 'passsword'