標籤:replica 查詢 刪除使用者 img rename ati cut 串連 儲存
使用者管理
1、 查詢使用者
use user;
select host,user from user;
2、 建立使用者
create user hkx001 IDENTIFIED by ‘hkx001‘;
create user [email protected] IDENTIFIED by ‘hkx001‘;
註:[user]@[IP]表示user用戶端必須ip地址必須為[IP],才能串連服務端。[IP]支援模糊比對%_。
3、 修改使用者密碼
set password for hkx001=‘hkx002‘;
4、 重新命名使用者
rename user hkx001 to hkx002;
5、 刪除使用者
drop user hkx001;
許可權管理
1、 查詢許可權
show grants for hkx001;
2、 賦予許可權
grant select on world.* to hkx001;
3、 回收許可權
revoke select on world.* from hkx001;
4、 重新整理許可權
flush privileges;
註:修改使用者權限後執行此命令。
5、 許可權表
|
許可權 |
說明 |
|
all |
|
|
alter |
|
|
alter routine |
使用alter procedure 和drop procedure |
|
create |
|
|
create routine |
使用create procedure |
|
create temporary tables |
使用create temporary table |
|
create user |
|
|
create view |
|
|
delete |
|
|
drop |
|
|
execute |
使用call和預存程序 |
|
file |
使用select into outfile 和load data infile |
|
grant option |
可以使用grant和revoke |
|
index |
可以使用create index 和drop index |
|
insert |
|
|
lock tables |
鎖表 |
|
process |
使用show full processlist |
|
reload |
使用flush |
|
replication client |
伺服器位置訪問 |
|
replocation slave |
由複製從屬使用 |
|
select |
|
|
show databases |
|
|
show view |
|
|
shutdown |
使用mysqladmin shutdown 來關閉mysql |
|
super |
|
|
update |
|
|
usage |
無存取權限 |
mysql使用者管理