MySQL用户操作语句

查看所有用户:

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';

点击量:27

发表评论

电子邮件地址不会被公开。 必填项已用*标注

16 − 5 =