创建数据库
create database 数据库;
选择数据库
use 数据库;
创建用户
create user '用户名'@'IP地址' identified by '密码';
授权
grant all privileges on 数据库 to '用户名'@'IP地址';
撤销授权
revoke all privileges on 数据库.* from '用户名'@'IP地址';
刷新权限
flush privileges;
查看权限
show grants for '用户名'@'IP地址';
修改密码
alter user '用户名'@'IP地址' identified by '新密码';
撤销所有授权
revoke all privileges, grant option from '用户名'@'IP地址';
查询变量
show variables; set global max_connections=500;