資安

MySQL添加用戶並賦予權限

mysql8以上使用,mysql數據庫,user表
創建用戶:

create user '用戶名'@'%' identified by '密碼';

修改用戶名密碼:

alter user '用戶名'@'%' identified with mysql_native_password by '密碼';

授權:
權限有 create,select,insert,update,delete。
*可以表示所有的數據庫或者所有的表。

grant insert,select,update on 數據庫名.表名 to '用戶名'@'%';

Leave a Reply

Your email address will not be published. Required fields are marked *