http://blog.csdn.net/andy_yf/article/details/7487519 关于mysql授权
新建用户
CREATE USER admin IDENTIFIED BY '1234'
授权
GRANT INSERT,DELETE,UPDATE,SELECT,DROP,CREATE ON lshy.* TO admin@"%" IDENTIFIED BY "1234";
GRANT ALL PRIVILEGES ON goubuy.* TO admin@localhost IDENTIFIED BY 'admin';
GRANT ALL PRIVILEGES ON *.* TO root@'%' IDENTIFIED BY 'root';
修改密码
UPDATE mysql.user SET PASSWORD=PASSWORD('1234') WHERE USER='admin' AND HOST='localhost';
撤销权限
REVOKE ALL ON goubuy.* FROM admin@localhost;
REVOKE INSERT,DELETE,UPDATE,SELECT,DROP,CREATE ON lshy.* FROM gps@"%" IDENTIFIED BY "jinze(gps)";
权限类型
SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,INDEX,ALTER,GRANT OR ALL
新建用户
CREATE USER admin IDENTIFIED BY '1234'
授权
GRANT INSERT,DELETE,UPDATE,SELECT,DROP,CREATE ON lshy.* TO admin@"%" IDENTIFIED BY "1234";
GRANT ALL PRIVILEGES ON goubuy.* TO admin@localhost IDENTIFIED BY 'admin';
GRANT ALL PRIVILEGES ON *.* TO root@'%' IDENTIFIED BY 'root';
修改密码
UPDATE mysql.user SET PASSWORD=PASSWORD('1234') WHERE USER='admin' AND HOST='localhost';
撤销权限
REVOKE ALL ON goubuy.* FROM admin@localhost;
REVOKE INSERT,DELETE,UPDATE,SELECT,DROP,CREATE ON lshy.* FROM gps@"%" IDENTIFIED BY "jinze(gps)";
权限类型
SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,INDEX,ALTER,GRANT OR ALL