本文主要是介绍【Mysql】1130-host xxx.xxx.xxx.xxx is not allowed to connect to this MySql server,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
解决方法:
改表法
更改 "mysql" 数据库里的 "user" 表里的 "host" 项,从"localhost"改称"%"
update user set host = '%' where user = 'root';
flush privileges;
授权法
GRANT ALL PRIVILEGES ON *.* TO 'xxx.xxx.xxx.xxx' @'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
FLUSH PRIVILEGES;
推荐方法
mysql -h localhost -u root
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION / /赋予任何主机访问数据的权限
FLUSH PRIVILEGES //修改生效
EXIT //退出MySQL服务器
这篇关于【Mysql】1130-host xxx.xxx.xxx.xxx is not allowed to connect to this MySql server的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!