mysql5.7 改root密码

$ /etc/init.d/mysqld stop

safe_mysqld --skip-grant-tables --user=root &

update mysql.user set password=PASSWORD('新密码') where User='root';

flush privileges;

#######

创建一个用户叫test1 并授权

grant select,insert,update,delete on . to test1@”%” Identified by “abc”;

FLUSH PRIVILEGES;

你可能感兴趣的:(mysql5.7 改root密码)