mysql修改配置sql

查看密码等级:

SHOW VARIABLES LIKE ‘validate_password%’;

修改为最弱等级:

set global validate_password_policy=LOW;

修改密码需要的长度 :

set global validate_password_length=6;

修改当前用户密码:

ALTER USER USER() IDENTIFIED BY ‘123456’;

修改其他用户密码:

ALTER USER ‘jeffrey’@‘localhost’ IDENTIFIED BY ‘123456’;

修改密码过期时间:

ALTER USER ‘jeffrey’@‘localhost’ IDENTIFIED BY ‘123456’ PASSWORD EXPIRE;

设置密码用不过期:

ALTER USER ‘jeffrey’@‘localhost’ IDENTIFIED BY ‘123456’ PASSWORD EXPIRE NEVER;

设置允许远程登陆:

update user set host=‘%’ where user=‘root’;

你可能感兴趣的:(入门MySql,mysql)