添加mysql用户
http://my.oschina.net/u/1179414/blog/202377
允许远程ip连接
GRANT select,insert,update,delete ON *.* TO root@"172.16.16.152" IDENTIFIED BY "youpassword";
查看所有用户的所有权限
SELECT DISTINCT CONCAT('User: ''',user,'''@''',host,''';') AS query FROM mysql.user
删除权限
mysql> revoke all on *.* from sss@localhost ; Query OK, 0 rows affected (0.00 sec) REVOKE语句只能取消用户的权限,而不可以删除用户。即使取消了所有的权限,用户仍然可以连接到服务器。要想彻底的删除用户,必须使用DELETE语句将该用户的记录从MySQL数据库中的user表中删除。该语句的语法格式如下: Delete from user where user = "user_name" and host = "host_name" ; 使用DELETE删除用户sss,代码如下: mysql> use mysql Database changed mysql> delete from user where user='sss' and host='localhost' ; mysql>flush privileges ; Query OK, 1 row affected (0.02 sec) 其中,delete用于删除用户,flush告诉服务器重新加载授权表。