密码验证策略修改,修改配置文件,加上下面的2句
[mysqld]
plugin-load-add=validate_password.so
validate_password_policy=LOW
创建用户的命令:
CREATE USER 'username'@'host' IDENTIFIED BY 'password';
host为%表示任意地址,除了本地登录
授权用户:
GRANT privileges ON databasename.tablename TO 'username'@'host';
flush privileges;
privileges取值(中间用,
隔开):
- ALL
- select
- delete
- create
- insert
- update
- alter
databasename.tablename . 表示所有的库表都有权限
修改密码:
SET PASSWORD FOR 'pig'@'%' = PASSWORD("123456");
删除 用户:
DROP USER 'username'@'host';