mysql使用者管理

來源:互聯網
上載者:User

標籤: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使用者管理

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.