MySQL5.6/5.7/8.0版本授权用户远程连接
MySQL5.6版本
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'IDENTIFIED BY '123456' WITH GRANT OPTION;
MySQL5.7版本
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'IDENTIFIED BY '123456'; mysql> flush privileges;
MySQL8.0版本 (好像不能使用root用户,待测试。。。)
1)创建用户
mysql>create user chenadmin@'%' identified by 'Chenadmin0.';
2)授权示例
mysql>grant all privileges on *.* to chenadmin@'%' with grant option;
3)刷新权限
mysql>flush privileges;
4)修改远程连接用户的加密规则
mysql>ALTER USER 'chenadmin'@'%' IDENTIFIED WITH mysql_native_password BY 'Chenadmin0.';
OK,搞定 !