查看所有用户:
mysql> SELECT DISTINCT CONCAT('User: ''',user,'''@''',host,''';') AS query FROM mysql.user;
修改指定用户的密码:
mysql> SET PASSWORD FOR 'bob'@'%.example.org' = PASSWORD('cleartext password');
修改用户:
mysql> RENAME USER 'jeffrey'@'localhost' TO 'jeff'@'127.0.0.1';
创建用户:
mysql> CREATE USER 'repl'@'%.mydomain.com' IDENTIFIED BY 'slavepass';
删除用户:
mysql> DROP USER 'jeffrey'@'localhost';
Visits: 248