CREATE USER 'test1'@'localhost' IDENTIFIED BY 'test1'; CREATE USER "用户"@"host" IDENTIFIED BY "密码" 当不限定host名字 用通配符 % 授权(记得执行 flush priviledges) GRANT priv_type ON database.table TO Name@Host grant all on *.* to 'test1'@'%'; grant select,insert,update,delete,create,drop on vtdc.employee to joe@10.163.225.87 identified by ‘123′;
权限列表
SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER
一般都是限定某个用户在某个库的全部角色