@chenyiliang
2020-03-17T07:19:55.000000Z
字数 977
阅读 938
Mysql
## get temp password
grep 'temporary password' /var/log/mysqld.log
## set new password
set global validate_password_policy=0;
set global validate_password_length=1;
set global validate_password.policy=0;
set global validate_password.length=1;
ALTER USER 'root'@'localhost' IDENTIFIED BY 'asdvg@12358';
ALTER USER 'root'@'%' IDENTIFIED BY 'asdvg@12358';
ALTER USER 'zhpt'@'%' IDENTIFIED WITH mysql_native_password BY 'yanfa@999';
set global validate_password_policy=0;
--insert into mysql.user(Host,User,Password) values("localhost","test",password("1234"));
CREATE USER 'username'@'host' IDENTIFIED BY 'PASSWORD'
CREATE USER 'MasterServer'@'%' IDENTIFIED BY 'asdvg@12358'
CREATE USER 'zhpt'@'%' IDENTIFIED BY 'yanfa@999';
CREATE USER 'root'@'%' IDENTIFIED BY 'yanfa@999';
GRANT privileges ON databasename.tablename TO 'username'@'host'
GRANT ALL PRIVILEGES ON *.* TO 'MasterServer'@'%' IDENTIFIED BY 'asdvg@12358' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO 'zhpt'@'%' IDENTIFIED BY 'yanfa@999' WITH GRANT OPTION;
FLUSH PRIVILEGES;