zoukankan      html  css  js  c++  java
  • 使用select和show命令查看mysql数据库系统信息

    (1).select

      显示当前日期和时间

    mysql> select now();
    +---------------------+
    | now()               |
    +---------------------+
    | 2019-06-05 13:46:20 |
    +---------------------+
    1 row in set (0.00 sec)
    

      显示当前日期

    mysql> select curdate();
    +------------+
    | curdate()  |
    +------------+
    | 2019-06-05 |
    +------------+
    1 row in set (0.04 sec)
    

      显示当前时间

    mysql> select curtime();
    +-----------+
    | curtime() |
    +-----------+
    | 13:48:15  |
    +-----------+
    1 row in set (0.00 sec)
    

      显示当前所在数据库

    mysql> use test_db;
    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
    mysql> select database();
    +------------+
    | database() |
    +------------+
    | test_db    |
    +------------+
    1 row in set (0.00 sec)
    

      显示Mysql版本

    mysql> select version(); 
    +-----------+
    | version() |
    +-----------+
    | 5.7.16    |
    +-----------+
    1 row in set (0.00 sec)

      显示当前用户

    mysql> select user();
    +----------------+
    | user()         |
    +----------------+
    | root@localhost |
    +----------------+
    1 row in set (0.00 sec)

    (2).show

      show variables;显示变量

      show global variables;显示全局变量

      show global variables like '%version%';显示版本信息

    mysql> show global variables like '%version%';
    +-------------------------+------------------------------+
    | Variable_name           | Value                        |
    +-------------------------+------------------------------+
    | innodb_version          | 5.7.16                       |
    | protocol_version        | 10                           |
    | slave_type_conversions  |                              |
    | tls_version             | TLSv1,TLSv1.1                |
    | version                 | 5.7.16                       |
    | version_comment         | MySQL Community Server (GPL) |
    | version_compile_machine | x86_64                       |
    | version_compile_os      | Linux                        |
    +-------------------------+------------------------------+
    8 rows in set (0.00 sec)

       show variables like '%storage_engine%';显示默认的存储引擎

    mysql> show variables like '%storage_engine%'; 
    +----------------------------------+--------+
    | Variable_name                    | Value  |
    +----------------------------------+--------+
    | default_storage_engine           | InnoDB |
    | default_tmp_storage_engine       | InnoDB |
    | disabled_storage_engines         |        |
    | internal_tmp_disk_storage_engine | InnoDB |
    +----------------------------------+--------+
    4 rows in set (0.00 sec)
    

      

  • 相关阅读:
    翻转二叉树 递归
    移动零 双指针
    多数元素
    laravel 使用PhantomMagick导出pdf ,在Linux下安装字体
    jQuery验证控件jquery.validate.js汉化
    windows 下使用Linux子系统
    Oracle12C RAC数据库grid&Oracle打补丁升级指导-来自ORACLE官方文档
    关于oracle数据库性能监控指标
    oracle在线添加日志组和日志组成员
    chr(39)表示单引'
  • 原文地址:https://www.cnblogs.com/diantong/p/10979155.html
Copyright © 2011-2022 走看看