zoukankan      html  css  js  c++  java
  • MySQL权限分配

    1、给一个数据库分配只读账号
     
    GRANT SElECT ON `bstic`.* TO 'readonly'@'%'  IDENTIFIED BY "123456";
    or
    GRANT SElECT ON bstic.* TO 'readonly'@'%'  IDENTIFIED BY "123456";
     
    2、多个数据库分配只读权限(只能单独一个一个的分配)
     
    GRANT SELECT ON *.* to 'yu'@'10.10.10.10' IDENTIFIED BY '123456';
    GRANT SElECT ON `bstic-1`.* TO 'readonly'@'%'  IDENTIFIED BY "123456";
    GRANT SElECT ON `bstic-2`.* TO 'readonly'@'%'  IDENTIFIED BY "123456";
     
    3、一个数据库读写权限账号
     
    grant all privileges on `bstic`.* to 'yu'@'10.10.10.10' identified by '123456';
     
    4、多个数据库读写权限账号(只能单独一个一个的分配)
     
    grant all privileges on `bstic`.* to 'yu'@'10.10.10.10' identified by '123456';
     
    grant all privileges on `bstic-1`.* to 'yu'@'10.10.10.10' identified by '123456';
     
    5、其中一个数据库读写权限,其他数据库只读权限
     
    GRANT SELECT ON *.* to 'yu'@'10.10.10.10' IDENTIFIED BY '123456';
    grant all privileges on `bstic`.* to 'yu'@'10.10.10.10' identified by '123456';
     
    6、命令行查看用户权限
     
    show grants for 'yu'@'%';
     
    7、删除用户
     
    DROP USER 'yu'@'localhost';
  • 相关阅读:
    STM32 端口复用配置
    stm32 新建文件记得添加到工程
    keil解决SYSTEMsysstm32f10x.h(298): error: #67: expected a "}"
    解决Keil复制中文乱码
    STM32 MPU6050 源码
    STM32 PWM输出
    STM32定时器
    STM32 看门狗操作姿势
    开课博客
    第二周学习进度
  • 原文地址:https://www.cnblogs.com/qingchen-24K/p/7344428.html
Copyright © 2011-2022 走看看