mysql命令整理

1.连接mysql
mysql -h localhost -u root -p
2.解决一个问题 your password dose not satisfy the current policy requirement.

查看初始密码策略
show variables like ‘validate_password%’;
mysql命令整理_第1张图片
密码policy 级别设置
set gloabl validate_password_policy=LOW;
密码长度设置
set global validate_password_length=6;

3.创建新用户为mysql
create user ‘cbuser’@‘localhost’ identified by ‘cbpass’

4.给用户授权
grant all on cookbook.* to ‘cbuser’@‘localhost’;

你可能感兴趣的:(mysql命令整理)