zoukankan      html  css  js  c++  java
  • mysql基础操作(三)

    DCL语句主要是DBA用来管理系统中的对象权限。

    例:

      创建一个数据库user1,具有对test1数据库中所有表的select 、inster权限:

    mysql> grant select,insert on test1.* to 'user1'@'%' identified by 'yan123';
    Query OK, 0 rows affected (0.00 sec)

    mysql> flush privileges;
    Query OK, 0 rows affected (0.00 sec)

    收回insert权限

    mysql> revoke insert on test1.* from 'user1'@'%';
    Query OK, 0 rows affected (0.00 sec)

    mysql> flush privileges;
    Query OK, 0 rows affected (0.01 sec)

    MYSQL帮助使用:

      “? contents”命令来显示所有可供查询的分类。

      例:

    mysql> ? contents;
    You asked for help about help category: "Contents"
    For more information, type 'help <item>', where <item> is one of the following
    categories:
    Account Management
    Administration
    Compound Statements
    Data Definition
    Data Manipulation
    Data Types
    Functions
    Functions and Modifiers for Use with GROUP BY
    Geographic Features
    Help Metadata
    Language Structure
    Plugins
    Procedures
    Storage Engines
    Table Maintenance
    Transactions
    User-Defined Functions
    Utility

     

    mysql> ? show
    Name: 'SHOW'
    Description:
    SHOW has many forms that provide information about databases, tables,
    columns, or status information about the server. This section describes
    those following:

    SHOW AUTHORS
    SHOW {BINARY | MASTER} LOGS
    SHOW BINLOG EVENTS [IN 'log_name'] [FROM pos] [LIMIT [offset,] row_count]
    SHOW CHARACTER SET [like_or_where]
    SHOW COLLATION [like_or_where]
    SHOW [FULL] COLUMNS FROM tbl_name [FROM db_name] [like_or_where]
    SHOW CONTRIBUTORS
    SHOW CREATE DATABASE db_name

  • 相关阅读:
    [NOIP2018-普及组] 对称二叉树
    UVA1637 【纸牌游戏 Double Patience】
    [SHOI2002]滑雪-题解
    题解 CF1437E 【Make It Increasing】
    题解 P4331 【[BalticOI 2004]Sequence 数字序列】
    NOIp 2020游记
    题解 P3825 【[NOI2017]游戏】
    题解 P6453 【[LNOI2014]LCA】
    题解 P6453 【[COCI2008-2009#4] F】
    题解 P5779 【[CTSC2001]聪明的学生】
  • 原文地址:https://www.cnblogs.com/xiaopeng01/p/11125216.html
Copyright © 2011-2022 走看看