mysql用戶與權限

創建用戶
create user ‘alice’@’localhost’ identified by ‘123456’ ;
使用create user 語句創建的新用戶沒有任何權限

創建blake用戶,密碼123456
grant select,update,delete,insert on . to ‘blake’@’localhost’ identified by ‘123456’ ;

查詢用戶權限
use mysql;
select * from user where User=’blake’;

刪除用戶以及權限
drop USER ‘alice’@’localhost’ ;
修改用戶名密碼
update mysql.user set Password=password(‘123123’) where User=’blake’ ;
set password for ‘blake’@’localhost’=password(123123); #這個最好

回收update權限
revoke update on . from ‘alice’@’localhost’;
查看權限
show grants for ‘alice’@’localhost’;

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章