MySQL權(quán)限操作
一、創(chuàng)建用戶
CREATE USER 'username'@'%' IDENTIFIED BY 'password';
二、授予權(quán)限
grant 權(quán)限 on `庫名`.`表名` to "用戶名"@"%";
權(quán)限包括
1、單個(gè)權(quán)限:select、insert、update、delete、create、drop、index、alter、grant、references、reload、shutdown、process、file
2、全部權(quán)限:all
三、查看用戶權(quán)限
show grants for "用戶名"@"%";
四、撤銷用戶權(quán)限
revoke 權(quán)限 on `庫名`.`表名` from "用戶名"@"%";
revoke和grant語法差不多,只需要把關(guān)鍵字 to 換成 from 即可