MySql 给用户分配权限

2022-07-12  本文已影响0人  Rinaloving

创建新用户:

create user 用户名 identified by '密码';

给用户分配指定数据库

grant all privileges on testdb.* to test@"%" identified by 'test';

授予权限
-- 增删改查各种权限

grant create,alter,drop,select,insert,update,delete on testdb.* to test@'%';

刷新权限
--刷新权限

flush privileges;

查看用户有哪些权限
--查看用户“test”

show grants for test;
上一篇 下一篇

猜你喜欢

热点阅读