Mysql用戶權限管理

[Author]: kwu

Mysql用戶權限管理

1、修改root用戶名密碼

set password for 'root'@'%'=password('123456'); 

% 代表所有的IP,password函數設置密碼

2、創建用戶並分配相應的資料庫權限

CREATE USER tom IDENTIFIED BY 'Abcd1234';
GRANT ALL PRIVILEGES ON data_analysis.* TO 'tom'@'%' IDENTIFIED BY 'Abcd1234';

3、刷新權限

flush privileges; 

You May Also Like