Update mysql.md

This commit is contained in:
zhh 2018-12-12 13:17:35 +08:00
parent 758046c5bb
commit 4fe75af81b

View File

@ -60,4 +60,14 @@ delete from emp where ename='zhangsan'
### 字符集相关
- 查看字符集show variables like 'character%'
- 创建数据库时指定字符集create database test1 character set utf8
- 创建数据库时指定字符集create database test1 character set utf8
### 权限相关
- 授予所有数据库的所有权限grant all privileges on *.* to z1@localhost identified by '123'
- 授予所有数据库的所有权限(包括grant)grant all privileges on *.* to z1@localhost with grant option
- 授予SUPER PROCESS FILE权限grant super,process,file on *.* to z3@localhost
- 只授予登录权限grant usage on *.* to z4@localhost
- 查看账号权限show grants for z1@localhost
- 修改自己的密码set password = password('123')
- 管理员修改他人密码set password for 'z1'@'localhost' = password('123')
- 删除账号drop user z2@localhost