问题: 其它主机如何访问另一个主机的数据库
java报错: null, message from server: "Host 'windows10.microdone.cn' is not allowed to connect to this MySQL server"
数据库报错: You are not allowed to create a user with GRANT
解决方法:
在mysql的bin目录下执行:mysql -u root -p密码 登陆到数据:
执行use mysql;
执行:update user set host='%' where user ='root';
执行刷新权限:flush privileges;
可以测试外网连接mysql服务器。
本文介绍了解决MySQL服务器不允许外部主机访问的问题。通过更新MySQL的users表设置root用户的host为'%',并刷新权限,实现从外部网络访问MySQL服务器。
2213





