zoukankan      html  css  js  c++  java
  • Mysql----基础操作

    • 创建数据库:create Database database_name
    mysql> create Database test2;
    Query OK, 1 row affected (0.00 sec)
    
    mysql> show databases;
    +--------------------+
    | Database           |
    +--------------------+
    | information_schema |
    | mysql              |
    | performance_schema |
    | sys                |
    | test               |
    | test2              |
    +--------------------+
    6 rows in set (0.00 sec)
    • 查看数据库:show databases;
    mysql> create Database test2;
    Query OK, 1 row affected (0.00 sec)
    
    mysql> show databases;
    +--------------------+
    | Database           |
    +--------------------+
    | information_schema |
    | mysql              |
    | performance_schema |
    | sys                |
    | test               |
    | test2              |
    +--------------------+
    6 rows in set (0.00 sec)
    • 选择数据库:use database_name
    mysql> show databases;
    +--------------------+
    | Database           |
    +--------------------+
    | information_schema |
    | mysql              |
    | performance_schema |
    | sys                |
    | test               |
    | test2              |
    +--------------------+
    6 rows in set (0.00 sec)
    
    mysql> use information_schema;
    Reading table information for completion of table and column names
    You can turn off this feature to get a quicker startup with -A
    
    Database changed #表示选择数据库成功
    • 删除数据库:DROP DATABASE database_name
    mysql> show databases;
    +--------------------+
    | Database           |
    +--------------------+
    | information_schema |
    | mysql              |
    | performance_schema |
    | sys                |
    | test               |
    | test2              |
    +--------------------+
    6 rows in set (0.00 sec)
    
    mysql> drop database test;
    Query OK, 0 rows affected (0.00 sec)
    
    mysql> show databases;
    +--------------------+
    | Database           |
    +--------------------+
    | information_schema |
    | mysql              |
    | performance_schema |
    | sys                |
    | test2              |
    +--------------------+
    5 rows in set (0.00 sec)
    • 查询默认存储引擎:SHOW VARIABLES LIKE 'storage_engine%';
    mysql> show variables like 'storage_engine%';
    Empty set (0.01 sec)
  • 相关阅读:
    CSS:清除浮动小技巧
    CSS:可见格式化模型BFC与应用
    JavaScript:所有视图属性和方法(innerWidth、outerHeight、clientX等)
    JavaScript:正则表达式(入门篇)
    JavaScript:六种继承比较
    表格内展示2行,超出部分省略
    Docker删除大量停止的container
    docker学习笔记
    使用redis实现分布式锁
    Sublime text 3 如何格式化HTML/css/js代码
  • 原文地址:https://www.cnblogs.com/aaron456-rgv/p/12748634.html
Copyright © 2011-2022 走看看