相比MySQL7, 8.x版本已经改变了修改远程登录密码的方式。
以root为例,正确的方式如下:
1. 添加远程登录的账户
create user 'root'@'%' identified with mysql_native_password by 'root';
2. 添加授权
grant all privileges on *.* to 'root'@'%' with grant option;
3. 添加用户
create user 'nacos'@'%' identified by 'nacos';
4.授权权限
grant all privileges on `ry-config`.* to 'nacos'@'%';