Hi all
I'm working on Linux(Debian) and trying to access mysql locally
through a java application. When I run the following code snip
pointing to the local machine I get
SQLException: Unable to connect to any hosts due to exception: java.net.ConnectException: Connection refused
The same statement works perfectly when connecting to mysql on my windows laptop.
PHP works perfectly on the linux box accessing mysql locally using the same username and password. Root is set to have full permissions from any host.
Can anybody think what the problem could be??
Thanks
Mellegem
I'm working on Linux(Debian) and trying to access mysql locally
through a java application. When I run the following code snip
Code:
Class.forName("com.mysql.jdbc.Driver").newInstance();
try{
java.sql.Connection con;
con = DriverManager.getConnection("jdbc:mysql://192.168.0.5/db1?user=root&password=dorris");
...
pointing to the local machine I get
SQLException: Unable to connect to any hosts due to exception: java.net.ConnectException: Connection refused
The same statement works perfectly when connecting to mysql on my windows laptop.
PHP works perfectly on the linux box accessing mysql locally using the same username and password. Root is set to have full permissions from any host.
Can anybody think what the problem could be??
Thanks
Mellegem