select user,host from user;
查找数据库权限
删除root账户
drop user 'root'@'localhost';
创建root
create user 'root'@'localhost' identified by '111111';
赋予权限
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION;
允许远程访问
update user set host='%' where user='root';
刷新权限
flush privileges;
退出
exit;
重启mysql
systemctl restart mysqld.service
最后
以上就是自觉灰狼最近收集整理的关于MySQL没有root账户的全部内容,更多相关MySQL没有root账户内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复