MySQL 5.7更改Root密码和Host

MySQL5.7对用户密码管理对更为严格。

为测试方便,需要将root对权限扩大为所有host。具体操作如下:

grep 'temporary password' /var/log/mysqld.log
2019-05-14T04:58:05.705428Z 1 [Note] A temporary password is generated for root@localhost: lXOe3R-jhV6W

mysqladmin -uroot -plXOe3R-jhV6W

alter user 'root'@'localhost' identified by 'xxxxxxx'; 

uninstall plugin validate_password;

alter user 'root'@'localhost' identified by 'xxxx';

grant all priviledges on *.* to 'root'@'%';

猜你喜欢

转载自www.cnblogs.com/hengwei/p/10861719.html
今日推荐