Monday, October 28, 2013

[MySQL] - Host 'xxx.xxx.x.xx' is not allowed to connect to this MySQL server

This problem happen when the mysql server doesn't allow remote connection. So first, go to the mysql server that you want to access.
  • Use putty (for windows) or terminal (for unix/linux) and perform the ssh
    ssh root@xxx.xxx.x.xx
    Enter password: (enter the server's password) 
  • Then type:
    mysql -u root -p
    Enter password:(enter the mysql password) 
  • Then type the following command:
    GRANT ALL PRIVILEGES ON *.* TO your_mysql_user@'%' IDENTIFIED BY 'your_mysql_password';
* make sure you change the value of your_mysql_user and your_mysql_password.Now you can access the mysql server through remote connection.

No comments:

Post a Comment