I have a java code and I am connecting to the mysql database with the following connection string.
String userName = "admin";
String password = "pass";
String url = "jdbc:mysql://<my IP>/dbase"; //not localhost
Class.forName ("com.mysql.jdbc.Driver").newInstance ();
conn = DriverManager.getConnection (url, userName, password);
When I make a JAR (Runnable JAR through eclipse), and take it to another machine in the same network I get an error
Access denied for user 'admin'@'<another machine IP' (using password: YES) //not localhost
The IP magically changed to another machine IP when I take the JAR to another machine. admin user has all privileges possible.
Whats wrong? Please help !!
rootis on the error message where in fact userName =admin? even if it changes its IP, the username will still beadminnotroot.admin