zoukankan      html  css  js  c++  java
  • mysql常用命令

    mysql> show variables like '%bind_address%';
    +---------------+-------+
    | Variable_name | Value |
    +---------------+-------+
    | bind_address  | *     |
    +---------------+-------+
    mysql> show grants for root@localhost;
    +---------------------------------------------------------------------+
    | Grants for root@localhost                                           |
    +---------------------------------------------------------------------+
    | GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION |
    | GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION        |
    +---------------------------------------------------------------------+
    mysql> select user,host from mysql.user;
    +---------------+-----------+
    | user          | host      |
    +---------------+-----------+
    | mysql.session | localhost |
    | mysql.sys     | localhost |
    | root          | localhost |
    +---------------+-----------+
    # 创建用户 并刷新权限
    mysql> create user adq@localhost identified by "cdq";
    Query OK, 0 rows affected (0.00 sec)
    # 所有权限
    mysql> grant all privileges on *.* to adq@localhost;
    Query OK, 0 rows affected (0.00 sec)
    # order库下所有表的select权限
    mysql> grant select on order.* to adq@localhost;
    Query OK, 0 rows affected (0.00 sec)
    # order库下所有表的select权限 并且只能查询id列
    mysql> grant select(id) on order.* to adq@localhost;
    Query OK, 0 rows affected (0.00 sec)
    
    # order库下所有表的select,insert,update,delete权限
    mysql> grant select,insert,update,delete on order.* to adq@localhost;
    Query OK, 0 rows affected (0.00 sec)
    
  • 相关阅读:
    团队冲刺第三天
    NoSQL数据库基础概述
    团队开发冲刺第九天
    团队开发冲刺第八天
    团队开发冲刺第七天
    团队开发冲刺第六天
    团队开发冲刺第五天
    团队开发冲刺第四天
    团队开发冲刺第三天
    第九周总结
  • 原文地址:https://www.cnblogs.com/huameixiao/p/14701480.html
Copyright © 2011-2022 走看看