MySQL数据库创建用户root@%

一、在Linux上以root账号登录主机

二、在主机上登录MySQL

mysql -uroot -p123456

三、先删除原来的 root@% 用户(若之前没有创建,则跳过此步骤)

drop user 'root'@'%';

四、删除成功了,再创建用户 root@%

create user 'root'@'%' identified with mysql_native_password by '123456';

五、接着授权

grant all on *.* to 'root'@'%' with grant option;

六、刷新配置

flush privileges;

七、退出

exit;

参考地址:https://blog.csdn.net/liaowenxiong/article/details/123325651

posted @ 2022-07-09 08:41  宜家数据小哥  阅读(3910)  评论(0编辑  收藏  举报