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

    1. 查看版本
    MariaDB [web1]> SELECT VERSION();
    
    2. 查看所有数据库
    MariaDB [web1]> SHOW DATABASES;
    
    3. 进入 web1 库
    MariaDB [(none)]> USE web1;
    
    4. 库中查看表
    MariaDB [web1]> SHOW TABLES;
    
    5. 查看其他库中表
    MariaDB [web1]> SHOW TABLES FROM web2;
    
    6. 查看创建表语句
    MariaDB [web1]> SHOW CREATE TABLE score;
    
    7. 查看表结构
    MariaDB [web1]> DESC score;
    
    8. 查看当前所在库
    MariaDB [web1]> SELECT DATABASE();
    
    9. 查看数据库支持的存储引擎
    MariaDB [web1]> SHOW ENGINES;
    +--------------------+---------+----------------------------------------------------------------------------------+--------------+------+------------+
    | Engine             | Support | Comment                                                                          | Transactions | XA   | Savepoints |
    +--------------------+---------+----------------------------------------------------------------------------------+--------------+------+------------+
    | MEMORY             | YES     | Hash based, stored in memory, useful for temporary tables                        | NO           | NO   | NO         |
    | MRG_MyISAM         | YES     | Collection of identical MyISAM tables                                            | NO           | NO   | NO         |
    | CSV                | YES     | Stores tables as CSV files                                                       | NO           | NO   | NO         |
    | BLACKHOLE          | YES     | /dev/null storage engine (anything you write to it disappears)                   | NO           | NO   | NO         |
    | MyISAM             | YES     | Non-transactional engine with good performance and small data footprint          | NO           | NO   | NO         |
    | ARCHIVE            | YES     | gzip-compresses tables for a low storage footprint                               | NO           | NO   | NO         |
    | FEDERATED          | YES     | Allows to access tables on other MariaDB servers, supports transactions and more | YES          | NO   | YES        |
    | PERFORMANCE_SCHEMA | YES     | Performance Schema                                                               | NO           | NO   | NO         |
    | SEQUENCE           | YES     | Generated tables filled with sequential values                                   | YES          | NO   | YES        |
    | InnoDB             | DEFAULT | Supports transactions, row-level locking, foreign keys and encryption for tables | YES          | YES  | YES        |
    | Aria               | YES     | Crash-safe tables with MyISAM heritage                                           | NO           | NO   | NO         |
    +--------------------+---------+----------------------------------------------------------------------------------+--------------+------+------------+
    
    10. 查看系统变量及其值
    MariaDB [web1]> SHOW VARIABLES;
    
    11. 查看某个系统变量
    MariaDB [web1]> SHOW VARIABLES LIKE '%wait_timeout%';
    +--------------------------+-------+
    | Variable_name            | Value |
    +--------------------------+-------+
    | innodb_lock_wait_timeout | 50    |
    | lock_wait_timeout        | 86400 |
    | wait_timeout             | 28800 |
    +--------------------------+-------+

    12.
    语言分类
    DQL (Data Query Language)            数据查询语言           select等
    DML (Data Manipulate Language)       数据操作语言           insert、update、delete等
    DDL (Data Define Language)           数据定义语言           create、drop、alter语句
    TCL (Transaction Control Language)   事务控制语言           commit,rollback等
    
    
  • 相关阅读:
    【华为云技术分享】使用keil5打开GD32F450i的MDK项目出现的问题以及J-Link无法烧录程序对应的解决方案
    【华为云技术分享】不为人知的稠密特征加入CTR预估模型的方法
    205. 判断两个字符串的模式是否相同 Isomorphic Strings
    541. 反转字符串2 Reverse String II
    插入排序,二分查找插入排序,使用二叉树的插入排序
    二分查找,求mid值的类型溢出问题
    二叉搜索树类的C#实现
    二叉搜索树,删除节点
    二叉搜索树的前驱节点和后继节点
    438. 匹配字符串(顺序不同但个数相同的字符串) Find All Anagrams in a String
  • 原文地址:https://www.cnblogs.com/luwei0915/p/15561658.html
Copyright © 2011-2022 走看看