[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';
GRANT ALL PRIVILEGES ON data_analysis.* TO 'tom'@'localhost' IDENTIFIED BY 'Abcd1234';
3、刷新权限
flush privileges;