mysql8.0授权:远程连接 ,修改加密方式

问题: 其它主机如何访问另一个主机的数据库

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';

更改加密方式:

update user set plugin='mysql_native_password' where user ='root';

执行刷新权限:flush privileges;

可以测试外网连接mysql服务器。

猜你喜欢

转载自blog.csdn.net/qq_39459412/article/details/81607305
今日推荐