This question already has an answer here:
I need to run MySQL (phpMyAdmin) on a LAN. This is my connection string:
Function Connection() As MySqlConnection
'Connect Database
MyConnection.ConnectionString = "server=192.168.1.101;" _
& "user id=root;" _
& "password=;" _
& "database=db1230018;"
'
MyConnection.Open()
Return MyConnection
End Function
I get an error:
Host '192.168.1.220' is not allowed to connect to this MySQL server
I have two PCs. One of them (Windows 7 - 192.168.1.101) runs a WAMP server (phpMyAdmin) and a VB.NET application using the above connection string. Now I want to run the application on the second pc (Windows) using the same database in 192.168.1.101. I already define a fixed IP on both PCs and disable firewalls. What's going on?
Probably you have no access rule defined for
root@192.168.1.220
. Then the server refuses this connection.Besides, you have to remove the restriction about the bind address in the config file.
Here you are told how that works:
in MySQL and remove the line
from
/etc/mysql/my.cnf
.As you get the said message from the server, it might be that the latter step isn't necessary any longer. Otherwise, you would get a message from the client that it is unable to connect to the server.
i think you haven't given sufficient privileges to the specified
'root'@'host'
you should look into the
user.mysql
table and give sufficient privileges to that particular'user'@'host'
.