1
|
SELECT* FROM mysql.user;`
|
1
2
3
|
CREATE USER 'testuser'@'localhost' IDENTIFIED BY 'password';
CREATE USER 'testuser'@'192.168.10.100' IDENTIFIED BY 'password';
CREATE USER 'testuser'@'%' IDENTIFIED BY 'password';
|
1
2
3
|
GRANT ALL PRIVILEGES ON testdb.* TO 'testuser'@'localhost';
GRANT ALL PRIVILEGES ON *.* TO 'testuser'@'localhost';
GRANT SELECT, INSERT, DELETE ON testdb1.* TO testuser@'localhost';
|
一般不需要执行
grant 之后要跟着 flush privileges 吗?-极客时间
1
|
SHOW GRANTS FOR 'testuser'@'localhost';
|