用户工具

站点工具


mysql:user

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

mysql -p -u root
CREATE USER 'user'@'localhost' IDENTIFIED BY 'password';
CREATE DATABASE DBNAME;
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 · 最后更改: 2018/01/18 14:29 由 admin