Hi guys.
I have previously been developing a Java application using 2 Windows Vista PCs that both have MySQL as the database. I have always created a user for each PC (specifying their IPs as allowed hosts to connect) on the other and then in the application the code for connecting to the database has the IP part as a variable as follows:
//some other code
public Connection getCon(String localip)
{
//some other code
String url = "jdbc:mysql://"+localip+"/dbEMPLOYEE";
//some other code with other connection parameters
}
Now, this has always worked for me with 2 Windows Vista machines.
My problem started when I started using a Windows 7 PC instead of a Windows Vista one, on one end while still maintaining the other Windows Vista machine.
The message I now keep getting whenever I change the IP to point from the Windows 7 (IP 192.168.0.112)machine to the Vista (IP 192.168.0.110), is as follows:
java.sql.SQLException: null, message from server: "Host 'dangari-PC' is not allowed to connect to this MySQL server"
It's as if it is just seeing the Host name and not the passed IP!
Mind you I have the user in both MySQL servers set with the other machine's IP such as:
on IP 192.168.0.112 i have user with host 192.168.0.110 and likewise on IP 192.168.0.110 i have user with host 192.168.0.112.
Kindly assist on how to handle this and know that your help is much appreciated.