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