创建用户
create user 用户名
identified by "密码";
例子:create user test identified by "123456";
赋予全部权限:
GRANT ALL PRIVILEGES ON *.* TO "zhang"@"%" IDENTIFIED BY "12345" WITH GRANT OPTION;
赋予查询权限:
grant select on test.v_a to usertest@'%';
FLUSH PRIVILEGES; ----刷新MySQL的系统权限相关表
查看当前用户(自己)权限:
show grants;
查看其他 MySQL 用户权限:
show grants for test@'%';
撤销权限:REVOKE ALL ON 数据库.表