概述
一、查看当前状态:
'''
mysql> status;
--------------
mysql
Ver 14.14 Distrib 5.6.41, for Win64 (x86_64)
Connection id:
2
Current database:
Current user:
root@localhost
SSL:
Not in use
Using delimiter:
;
Server version:
5.6.41 MySQL Community Server (GPL)
Protocol version:
10
Connection:
localhost via TCP/IP
Server characterset:
latin1
Db
characterset:
latin1
Client characterset:
gbk
Conn.
characterset:
gbk
TCP port:
3306
Uptime:
5 min 5 sec
Threads: 1
Questions: 9
Slow queries: 0
Opens: 67
Flush tables: 1
Open tabl
es: 60
Queries per second avg: 0.029
--------------
'''
二、查看当前用户:
'''
mysql> select user();
+----------------+
| user()
|
+----------------+
| root@localhost |
+----------------+
1 row in set (0.00 sec)
'''
三、查看当前时间:
'''
mysql> select current_time();
+----------------+
| current_time() |
+----------------+
| 17:48:28
|
+----------------+
1 row in set (0.00 sec)
mysql> select current_date();
+----------------+
| current_date() |
+----------------+
| 2018-10-17
|
+----------------+
1 row in set (0.00 sec)
mysql> select current_timestamp();
+---------------------+
| current_timestamp() |
+---------------------+
| 2018-10-17 17:48:54 |
+---------------------+
1 row in set (0.00 sec)
'''
四、查看所有数据库:
'''
mysql> show databases;
+--------------------+
| Database
|
+--------------------+
| information_schema |
| mysql
|
| performance_schema |
| test
|
+--------------------+
4 rows in set (0.00 sec)
'''
五、查看当前数据库模式:
'''
mysql> select database();
+------------+
| database() |
+------------+
| NULL
|
+------------+
1 row in set (0.00 sec)
'''
转载于:https://my.oschina.net/u/3323607/blog/2248111
最后
以上就是勤奋冰淇淋为你收集整理的mysql基础知识--状态查询的全部内容,希望文章能够帮你解决mysql基础知识--状态查询所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复