首页 > 代码库 > mysql 用户 登陆 权限相关

mysql 用户 登陆 权限相关

 1. CREATE USER ‘dog2‘@‘localhost‘ IDENTIFIED BY ‘‘;

将"localhost"改为"%",表示在任何一台电脑上都可以登录;也可以指定某台机器可以远程登录;

2. GRANT privileges ON databasename.tablename TO ‘username‘@‘host‘

GRANT all privileges ON mq.* TO ‘dog‘@‘localhost‘;

3. Delete FROM user Where User=‘test‘ and Host=‘localhost‘;

4. UPDATE user SET Password = PASSWORD(‘newpass‘) WHERE user = ‘root‘;

最后  flush privileges;

 

mysql 5.7密码安全策略

  SHOW VARIABLES LIKE ‘validate_password%‘;

set global validate_password_length=4;

 

mysql 用户 登陆 权限相关