授权MySQL root 用户所有权限

 1 -- 登录
 2 mysql -u root -p
 3 -- 查询mysql用户
 4 select user,host,authentication_string from mysql.user;
 5 -- 切换到mysql库
 6 use mysql;
 7 -- 修改root用户host
 8 update user set host='%' where user='root';
 9 -- 授权
10 GRANT ALL PRIVILEGES ON *.* TO 'root'@'%';
11 -- 刷新
12 FLUSH PRIVILEGES;

 

posted @ 2021-02-23 14:10  SpringCore  阅读(5642)  评论(0编辑  收藏  举报