centos7 mysql创建新用户

阅读更多
1、添加用户
如创建一个test用户,密码为test123,可以进行远程登录:
create user 'test'@'%' identified by 'test123'

ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

执行如下命令:
set global validate_password_policy=0;
set global validate_password_length=1;

2、授权
授权test用户有testDB数据库的所有操作权限:
grant all privileges on testDB.* to 'test'@'%' identified by 'test123'  WITH GRANT OPTION;


3、刷新表权限
flush privileges;  #刷新表权限

你可能感兴趣的:(centos7 mysql创建新用户)