初始安装MySQL时,修改密码:
set password=password("root");
刷新:
flush privileges;
use mysql;
查看用户
select host,user from user;
查看mysql当前密码的策略
show variables like 'validate_password%';
让用户可以在任意IP使用root
grant all privileges on *.* to root@"%" identified by "root";
创建root用户只可以本地使用
grant all privileges on *.* to root@"localhost" identified by "root";