when i am trying to log on mysql using my ip address i am getting error 1130 qht can i do for this
3 Answers
On your server run mysql from command line:
mysql -u root -p -h localhost -P 3306
Then run this command in mysql shell:
>use mysql
>GRANT ALL ON *.* to root@'%' IDENTIFIED BY 'yourpassword';
>FLUSH PRIVILEGES;
Have a nice time.

- 1
- 1

- 9,818
- 7
- 59
- 72
-
1This one should be the best answer imo. Nice thing, this "%" :) – Vlad Nicula Aug 31 '14 at 14:48
-
2Except it is a bad advice security-wise. One should always use the most precise rule, here specifying the client IP address as a host or its NAT public IP, or a rule matching his DHCP subnet ('192.168.1.%" for example) – mveroone May 03 '16 at 07:59
-
It has been fixed my issue. Thanks a lot. – Yang Wang Mar 26 '17 at 23:18
-
1osx's default mysql pkg was causing me a lot of trouble, this solves it. – Oct 19 '17 at 03:30
-
May 2018. Still applicable. Thank you. You may want to update the command due to `Warning (Code 1287): Using GRANT statement to modify existing user's properties other than privileges is deprecated and will be removed in future release. Use ALTER USER statement for this operation.` – jc__ May 18 '18 at 17:38
Your client IP is not allowed to connect to this server, you must add it to allowed client account For exemple, assuming you add an user account having all rights in one database :
grant all on db.* to 'username'@'192.168.0.1';
Where db is database name, username the username , and your clients IP is 192.168.0.1
See docs for details of user account creation

- 3,569
- 2
- 22
- 20
-
1this is SQL query to run on server with an account with enough privileges to do grant queries on the table – Benoit May 18 '10 at 14:10
On your server run mysql from command line:
mysql -u root -p -h localhost -P 3306 Then run this command in mysql shell:
use mysql
GRANT ALL ON . to root@'%' IDENTIFIED BY 'pass';
FLUSH PRIVILEGES;
Perfect! great steps and resolve the error Failure loading users data from backend [xx.xx.xx.x:3306] for service [Write Failover]. MySQL error 1130, Host
'xx.xx.xx.x' is not allowed to connect to this MariaDB server

- 1
- 1