zoukankan      html  css  js  c++  java
  • MySQL中表的基本操作1

    (1)查看MySQL中存在的数据库

     mysql> show databases;
     +--------------------+
     | Database           |
     +--------------------+
     | information_schema |
     | mysql              |
     | performance_schema |
     | test               |
     +--------------------+
     4 rows in set (0.00 sec)

    (2)创建数据库

     mysql> create database justforfun;
     Query OK, 1 row affected (0.08 sec)
     
     mysql> show databases;
     +--------------------+
     | Database           |
     +--------------------+
     | information_schema |
     | justforfun         |
     | mysql              |
     | performance_schema |
     | test               |
     +--------------------+
     5 rows in set (0.00 sec)

    (3)删除数据库

     mysql> drop database justforfun;
     Query OK, 0 rows affected (0.33 sec)
     
     mysql> show databases;
     +--------------------+
     | Database           |
     +--------------------+
     | information_schema |
     | mysql              |
     | performance_schema |
     | test               |
     +--------------------+
     4 rows in set (0.00 sec)

    (4)查看MySQL所支持的存储引擎

     mysql> show engines;
     +--------------------+---------+--------------------------------------------------
     
     ----------+--------------+------+------------+
     | Engine             | Support | Comment                                            
     
             | Transactions | XA   | Savepoints |
     +--------------------+---------+--------------------------------------------------
     
     ----------+--------------+------+------------+
     | MRG_MYISAM         | YES     | Collection of identical MyISAM tables              
     
             | NO           | NO   | NO         |
     | PERFORMANCE_SCHEMA | YES     | Performance Schema                                 
     
             | NO           | NO   | NO         |
     | InnoDB             | DEFAULT | Supports transactions, row-level locking, and 
     
     foreign keys | YES          | YES  | YES        |
     | CSV                | YES     | CSV storage engine                                 
     
             | NO           | NO   | NO         |
     | MyISAM             | YES     | MyISAM storage engine                              
     
             | NO           | NO   | NO         |
     | MEMORY             | YES     | Hash based, stored in memory, useful for temporary 
     
     tables  | NO           | NO   | NO         |
     +--------------------+---------+--------------------------------------------------
     
     ----------+--------------+------+------------+
     6 rows in set (0.04 sec)
     
     mysql> show engines \G
     *************************** 1. row ***************************
           Engine: MRG_MYISAM
          Support: YES
          Comment: Collection of identical MyISAM tables
     Transactions: NO
               XA: NO
       Savepoints: NO
     *************************** 2. row ***************************
           Engine: PERFORMANCE_SCHEMA
          Support: YES
          Comment: Performance Schema
     Transactions: NO
               XA: NO
       Savepoints: NO
     *************************** 3. row ***************************
           Engine: InnoDB
          Support: DEFAULT
          Comment: Supports transactions, row-level locking, and foreign keys
     Transactions: YES
               XA: YES
       Savepoints: YES
     *************************** 4. row ***************************
           Engine: CSV
          Support: YES
          Comment: CSV storage engine
     Transactions: NO
               XA: NO
       Savepoints: NO
     *************************** 5. row ***************************
           Engine: MyISAM
          Support: YES
          Comment: MyISAM storage engine
     Transactions: NO
               XA: NO
       Savepoints: NO
     *************************** 6. row ***************************
           Engine: MEMORY
          Support: YES
          Comment: Hash based, stored in memory, useful for temporary tables
     Transactions: NO
               XA: NO
       Savepoints: NO
     6 rows in set (0.00 sec)

    (5)查看MySQL的默认引擎

     mysql> show variables like 'storage_engine';
     +----------------+--------+
     | Variable_name  | Value  |
     +----------------+--------+
     | storage_engine | InnoDB |
     +----------------+--------+
     1 row in set (0.00 sec)
     
     mysql>


     

  • 相关阅读:
    交叉熵的数学原理及应用——pytorch中的CrossEntropyLoss()函数
    pytorch中如何使用DataLoader对数据集进行批处理
    Pytorch中的自动求导函数backward()所需参数含义
    Pytorch中的torch.cat()函数
    Pytorch中的squeeze()和unsqueeze()函数
    UBUNTU18.04安装网易云音乐并直接图标启动
    UBUNTU18.4环境下使用更好用的搜索引擎(无奈,只能起这样的标题)
    Ubuntu 18.04换国内源 中科大源 阿里源 163源 清华源
    共享栈
    C++(十七) — 宏代码、内联函数
  • 原文地址:https://www.cnblogs.com/Robotke1/p/3042842.html
Copyright © 2011-2022 走看看