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.
-
1This one should be the best answer imo. Nice thing, this "%" :) Commented Aug 31, 2014 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)– mverooneCommented May 3, 2016 at 7:59
-
-
1osx's default mysql pkg was causing me a lot of trouble, this solves it.– user3905644Commented Oct 19, 2017 at 3: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__Commented May 18, 2018 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
-
1this is SQL query to run on server with an account with enough privileges to do grant queries on the table– BenoitCommented May 18, 2010 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