创建账户
CREATE USER '用户名'@'主机' IDENTIFIED BY '密码';
示例
CREATE USER 'root'@'%' IDENTIFIED BY 'xxx%%%%*****123...';
设置数据库权限
GRANT ALL PRIVILEGES ON 数据库名字.权限 TO '用户名'@'主机';
示例
GRANT ALL PRIVILEGES ON db-test.* TO 'root'@'%';
CREATE USER '用户名'@'主机' IDENTIFIED BY '密码';
示例
CREATE USER 'root'@'%' IDENTIFIED BY 'xxx%%%%*****123...';
GRANT ALL PRIVILEGES ON 数据库名字.权限 TO '用户名'@'主机';
示例
GRANT ALL PRIVILEGES ON db-test.* TO 'root'@'%';
之前