create user 'test'@'%' identified with mysql_native_password by '1234';
grant all on *.* to 'test'@'%';
flush privileges;
用navicat登陆服务器数据库 修改数据库用户root的操作权限为'%' 其他改为y
并删除test账户和权限
退出后发现登不进去了
服务器端
通过root用户登陆mysql进入putty后授权
GRANT ALL ON *.* TO 'root'@'%';
flush privileges;
修改加密规则
ALTER USER 'root'@'localhost' IDENTIFIED BY 'yourpassword' PASSWORD EXPIRE NEVER;
ALTER USER 'root'@'localhost' IDENTIFIED BY '1234' PASSWORD EXPIRE NEVER;
更新 root 用户密码
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'yourpassword';
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '1234';
刷新权限
FLUSH PRIVILEGES;
wget
参考
1、https://blog.csdn.net/llf_cloud/article/details/83141338
2、https://www.cnblogs.com/liran123/p/10164564.html