mysql 创建用户并授权

创建用户

create user admin@'%' identified by '123456';

授权test表所有权限给admin

grant all privileges on test.* to 'admin'@'%' with grant option;

刷新

FLUSH PRIVILEGES;

查看授予的权限

show grants for admin@'%';

删除admin的所有权限

REVOKE all privileges ON test.* FROM admin@'%';

删除用户

DROP USER 'admin'@'%';

你可能感兴趣的:(1024程序员节)