【1】查看mysql数据库中的所有用户
1
| SELECT DISTINCT CONCAT('User: ''',user,'''@''',host,''';') AS query FROM mysql.user;
|
【2】查看某个用户的权限
1 2 3
| show grants for 'nextcloud'@'%';
select * from mysql.user where user='root' \G;
|
【3】查看当前用户
【4】修改用户密码
1 2 3
| use mysql; UPDATE user SET password=PASSWORD('新密码') WHERE user='用户'; flush privileges;
|
【5】修改用户权限及密码
1 2
| grant all privileges on nextcloud.* to 'nextcloud'@'%' identified by 'du..olctx..entest.1';
|
【6】删除用户
1
| drop user 'nextcloud'@'%';
|
转载自:
https://blog.csdn.net/GX_1_11_real/article/details/95052475