用户工具

站点工具


mysql:user

MySQL 添加/删除用户及修改用户权限

mysql -p -u root
CREATE USER 'user'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON database.table TO 'user'@'localhost';
GRANT ALL PRIVILEGES ON database.* TO 'user'@'localhost';
GRANT ALL PRIVILEGES ON *.* TO 'user'@'localhost';

GRANT SELECT, INSERT, DELETE ON database.* TO 'user'@'localhost';
FLUSH PRIVILEGES;
DROP USER 'user'@'localhost'

Reference

mysql/user.txt · 最后更改: 2017/03/27 10:01 由 admin