mysql 查询系统_使用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)
顯示當前所在數(shù)據(jù)庫
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)
總結(jié)
以上是生活随笔為你收集整理的mysql 查询系统_使用select和show命令查看mysql数据库系统信息的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 科技馆门票多少钱啊?
- 下一篇: 五险一金一个月多少钱啊?