ERROR 1130 (HY000): Host is not allowed to connect to this MySQL server.
Your root account, and this statement applies to any account, may only have been added with localhost access (which is recommended).
SELECT host FROM mysql.user WHERE User = 'root';
If you only see results with localhost and 127.0.0.1, you cannot connect from an external source. If you see other IP addresses, but not the one you're connecting from - that's also an indication. If you see %, well then, there's another problem altogether as that is "any remote source"
GRANT ALL PRIVILEGES ON . TO 'user'@'%' IDENTIFIED BY 'password'; FLUSH PRIVILEGES;
This is a typical firewall issues if you are using Windows OS particularly windows 7 or 8. Disabling your firewall from the Antivirus on your server (where your MySQL is installed) might not help.
Follow this steps:
- Go to the control panel of your Server (wamp server PC)
- Go System and Security
- Choose Windows Firewall
- Choose Advance Settings
- Choose Inbound Rule
- Choose New Rule - New Inbound Rule Wizard will pop up
- Choose Port and click next
- Choose TCP and click next
- Enter 80, 3306 (These are default ports respectively for Apache and Mysql servers on wamp) if you have changed them on your wamp server PC then indicate the appropriate ports
- Choose Allow the Connection
- Check or uncheck whether you will allow this ports on Private, Public or Domain Network
- Give the rule a name and click finish
Enjoy!
On ubuntu or linux os you can fix it by .
sudo nano /etc/mysql/mysql.conf.d/mysqld.cnf
modify bind address to
bind-address = 0.0.0.0
Afer that connect to your my sql console
Then restart the mysql server
sudo systemctl restart mysql
Note: i actually had issues updating a user so i created a new user for remote connection which would have all the permission