• 使用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)
    

      

  • 相关阅读:
    MDaemon运行六年方法
    [转帖]如何将一张图片写入数据库SQL,并能正确在C#网页中显示
    【转】CSS 与 HTML5 响应式图片
    【原】设计稿中字体pt与px之间的转化
    【原】[webkit移动开发笔记]之使用chrome进行手机开发
    【原】[webkit移动开发笔记]之兼容iPhone4和iPhone5的方法
    【原】[webkit移动开发笔记]之空链接是使用javascript:void(0)还是使用#none
    CSS3Ps Photoshop图层特效转CSS3代码
    【原】[webkit移动开发笔记]之CSS3径向渐变
    【转】浏览器加载渲染网页过程解析总结(三)
  • 原文地址:https://www.cnblogs.com/diantong/p/10979155.html
Copyright © 2020-2023  润新知