X
185 Rate this article:
No rating

Internal: Host '[name or IP]' is not allowed to connect to this MySQL serverConnection closed by...

Anonym
Topic:
Content excerpt from:

http://www.linuxquestions.org/questions/linux-networking-3/cant-connect-to-mysql-394133/

Problem attempting to make connection to MySQL server:

"[root@e mysql]# telnet 192.168.1.10 3306
Trying 192.168.1.10...
Connected to 192.168.1.10 (192.168.1.10).
Escape character is '^]'.
EHost '192.168.1.10' is not allowed to connect to this MySQL serverConnection closed by foreign host.

"Discussion:

Solution:

"MySQL server uses permission based connection privileges.
So the host(IP of this host box) from where you are trying to connect to mysql should be listed in the mysql's user table with proper privileges to allow connections.
Try the followng in that order to resolve:

1>At the console of the box on which mysql server is running type mysql -uroot -p
2> It will prompt you for root pasword is it was set. Once insidew mysql command shell type
user mysql;
3> now type the following command:

    grant all privileges on *.* to '<username>'@'' identified by ' ';

In above command replace with the username you want for connection. with the IP of the host from where you want the permission to connect to this mysql server(in you case this shall be 192.168.1.2) You can also use 192.168.% to allow connection from all IP that begin eith 192.168. Similarly replacing with just % will allow connection from all hosts for this username. Replace with the password you want.
4> type this command:

    flush privileges;

thats it.
Now you should be able to connect to this mysql server from that said host.
"Solution:
[Edit this field in the IDL-based Tech Tip Editor, v80]