首页 > 编程知识 正文

mysql用户权限管理,mysql 查看用户名

时间:2023-05-03 18:56:29 阅读:179500 作者:4622

【1】显示mysql数据库中的所有用户

selectdistinctconcat (' user : ' ',user,' ' @ ',host,';' ) AS query FROM mysql.user;

【2】查看某个用户的权限

show grants for 'nextcloud'@'% '; or select * from MySQL.userwhereuser=' root 'g;

【3】查看当前用户

选择用户(;

【4】更改用户密码

use mysql; UPDATE user SET password=PASSWORD (“新密码”) WHERE user=“用户”; flush privileges; 【5】变更用户权限和密码

grant权限on库名称.表名to '用户名' @ '网段' ' ‘ identified by ' '该用户的密码'; grantallprivilegesonnextcloud.* to ' next cloud ' @ ' % ' identified by ' du . ol CTX . entest.1 '; 【6】删除用户

drop user 'nextcloud'@'% '; 【7】补充

mysql数据库许可证链接为以下:

3359 blog.csdn.net/GX _1_ 11 _ real/article/details/81200566

ps:

所有案例的数据库都是测试库,如何才能生成数据库,用户很少,权限设置也没有三权分立的原则

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。