Error 1130: #HY000 Host ‘hostname’ is not allowed to connect to this MySQL server
Cause: The host that you are using to connect MySQL Server does not have privilege
Solution: Grant required privileges
GRANT
For ex:- if you are connecting as root then use below syntax
Mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@’test-server’ IDENTIFIED BY ‘test’ ;
Now you should able to see a new user in mysql.user table.
Mysql> select host,user from mysql.user;
+------+---------------------------
| User | Host
+------+---------------------------
| root | test-server
+------+---------------------------
If you want to grant privilege to a host on specific database try below syntax.
mysql> GRANT ALL PRIVILEGES ON test.* TO 'root'@’test-server’ IDENTIFIED BY ‘test’ ;
Error 1130: #HY000 Host ‘IP address’ is not allowed to connect to this MySQL server
Cause: The user host IP address is not allowed to connect to MySQL Server
Solution: Grant the privilege to host IP address
mysql> GRANT ALL PRIVILEGES ON *.* TO ‘user’@’IPADDRESS’ IDENTIFIED BY ‘password’ ;
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@’x.x.x.x’ IDENTIFIED BY ‘test’ ;
ERROR 1045 (28000): Access denied for user 'root'@hostname' (using password: NO)
Cause: The root user is password protected and you need to use password parameter in order to connect
Solution: - Try to connect MySQL Server using below command
# mysql -u root -h test-server –p
ERROR 1045 (28000): Access denied for user 'root'@hostname' (using password: YES)
Cause: The 'root'@hostname' doesn’t have privilege to connect MySQL Server
Solution: - Grant permission using below command.
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@hostname' IDENTIFIED BY ‘password’
Regards,
Satishbabu Gunukula
http://www.oracleracexpert.com