修改root账号  root  qwer123
use mysql;
update mysql.user set authentication_string=password('qwer123') where user='root' ;
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY 'qwer123' WITH GRANT OPTION;
flush privileges;


use mysql;
drop user root@'%';
update mysql.user set authentication_string=password('qwer123') where user='root' ;
flush privileges;



创建应用账号: teachinguser  qwer123
use mysql;
CREATE USER 'teachinguser'@'10.10.10.%' IDENTIFIED BY 'qwer123';
CREATE USER 'teachinguser'@'localhost' IDENTIFIED BY 'qwer123';

grant all privileges on basedata.*               to teachinguser@'10.10.10.%';                         

grant all privileges on basedata.*               to teachinguser@'localhost';                         
flush privileges;


创建只读账号: rouser   qwer123
use mysql;
CREATE USER 'rouser'@'10.10.10.%' IDENTIFIED BY 'qwer123';
CREATE USER 'rouser'@'localhost' IDENTIFIED BY 'qwer123';

grant select  on *.* to rouser@'10.10.10.%';
grant select  on *.* to rouser@'localhost';
flush privileges;



创建DBA账号:  dbauser   qwer123
use mysql;
CREATE USER 'dbauser'@'10.10.10.%' IDENTIFIED BY 'qwer123';
CREATE USER 'dbauser'@'localhost' IDENTIFIED BY 'qwer123';

grant all privileges on *.* to dbauser@'10.10.10.%' WITH GRANT OPTION;
grant all privileges on *.* to dbauser@'localhost' WITH GRANT OPTION;
flush privileges;

 

相关文章:

  • 2021-04-16
  • 2022-02-08
  • 2021-09-03
  • 2022-12-23
  • 2021-08-22
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-03
  • 2022-12-23
  • 2021-12-19
  • 2021-11-23
  • 2021-12-12
相关资源
相似解决方案