zoukankan      html  css  js  c++  java
  • mysql--权限问题

    #创建用户
    create user 'lin'@'localhost' identified by '123';

    #insert,delele,update,select
    #级别1:对所有库,下的所有表,下的所有字段
    grant select on *.* to 'lin1'@'localhost' identified by '123';

    #级别2:对db1库,下的所有表,下的所有字段
    grant select on db1.* to 'lin2'@'localhost' identified by '123';

    #级别3:对表db1.t1,下的所有字段
    grant select on db1.t1 to 'lin3'@'localhost' identified by '123';

    #级别4:对表db1.t1,下的id,name字段
    grant select (id,name) on db1.t1 to 'lin4'@'localhost' identified by '123';
    grant select (id,name),update (name) on db1.t1 to 'lin5'@'localhost' identified by '123';

    #修改完权限后,要记得刷新权限
    flush privileges;


    localhost本地主机, identified by以什么..鉴别
    grant 授予,允许. select挑选
    create user 'panyu'@'localhost' identified by '123'
    创建用户

    grant select on *.* to 'pan'@'localhost' identified by '123'
    授予pan查看所有库以及所有字段的权限
    grant select on db1.* to 'yu'@'localhost' identified by '123';
    授予yu查看所有该库下面的所有表的权限
    grant select on db1.t1 to 'zhuge'@'loaclhost' identified by '123';
    授予zhuge查看db1库,下面t1表里的字段.
    grant select (id,name) on db1.t1 to 'guanyu'@'localhost' identified by '123';
    grang select (id,name) update(name) on db1.t1 to 'zhangfei'@identified by '123';

  • 相关阅读:
    创建100个文件,并对每个文件赋值
    vsftpd服务程序的三种认证模式
    slf4j打印日志必须的三个依赖包
    MySql镜像安装
    java子类调用父类构造器函数
    shell脚本批量调用接口
    go语言生成可执行文件
    linux通过VMware和主机相连连接互联网
    yum源配置
    vmware上安装linux过程记录
  • 原文地址:https://www.cnblogs.com/52forjie/p/7482160.html
Copyright © 2011-2022 走看看