bitsCN.com
MySQL数据库开启root用户远程登录
如果mysql不支持远程连接,会出现提示:错误代码是1130,ERROR 1130: Host 192.168.0.10 is not allowed to connect to this MySQL server ,解决此问题有以下2个方法:
1、改表法:在本机登入mysql后,更改“mysql”数据库里的“user”表里的“host”项,从”localhost”改为'%'。
mysql>
mysql>use mysql;
mysql>select 'host' from user where user='root'; #查看mysql库中的user表的host值(即可进行连接访问的主机/IP名称)
mysql>update user set host = '%' where user ='root'; #修改host值(以通配符%的内容增加主机/IP地址,当然也可以直接增加某个特定IP地址,如果执行update语句时出现ERROR 1062 (23000): Duplicate entry '%-root' for key 'PRIMARY' 错误,需要select host from user where user = 'root';
查看一下host是否已经有了%这个值,如果有了直接执行下面的flush privileges;即可)
mysql>flush privileges;
mysql>select host,user from user where user='root';
mysql>quit
退出后会回到DOS正常的提示符状态,此时可以通过远程连接Mysql了!bitsCN.com
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号