mysql8.0++root用户授权-远程连接

 

利用系统自带用户:debian-sys-maint 先登陆mysql8.0 

初始密码存放在/etc/mysql/debian.cnf文件中

 

 

在 mysql 数据库的 user 表中查看当前 root 用户的相关信息

mysql> select host,user,authentication_string,plugin from user;

 

 

 

授权 root 用户的所有权限并设置远程访问

mysql> grant all on *.* to 'root'@'%';

alter user 'root'@'%' identified with mysql_native_password by '设置自己的密码';  #大小写字母+特殊字符+数字

mysql> flush privileges;  #刷新权限

查看最终用户列表

 

posted @ 2022-04-27 10:59  向往明天-tsingyun  阅读(297)  评论(0编辑  收藏  举报