栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

mysql权限管理

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

mysql权限管理

用户的创建
create user "yanzhao1"@"localhost" identified by "2019210902";

create user "yanzhao2"@"localhost" identified by "2019210902";

create user "yanzhao3"@"localhost" identified by "2019210902";

create user "yanzhao4"@"localhost" identified by "2019210902";
grant select,insert,update on *.* to "yanzhao4"@"localhost";

用户授权
  • 授予第一个用户为数据库级用户,对 dreamhom 拥有所有权
grant all on dreamhom.* to “yanzhao1”@”localhost”;
  • 授予第二个用户为表级用户,对dreamhom中的staff 表具有select,insert,delete 权限
grant select,insert,delete on dreamhom.staff to “yanzhao2”@”localhost”;
  • 授予第三个用户为列级用户,对 dreamhom 中的 staff 表的 fname列以及 lname 拥有 select 权限
grant select(fname,lname) on dreamhom.staff to “yanzhao3”@”localhost”;
权限回收
revoke select on *.* from "yanzhao4"@"localhost";
删除用户
drop user "yanzhao4"@"localhost";
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/914369.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号