一、查看当前状态:
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44''' 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 -------------- '''
二、查看当前用户:
复制代码
1
2
3
4
5
6
7
8
9
10''' mysql> select user(); +----------------+ | user() | +----------------+ | root@localhost | +----------------+ 1 row in set (0.00 sec) '''
三、查看当前时间:
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25''' 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) '''
四、查看所有数据库:
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15''' mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | test | +--------------------+ 4 rows in set (0.00 sec) '''
五、查看当前数据库模式:
复制代码
1
2
3
4
5
6
7
8
9
10''' mysql> select database(); +------------+ | database() | +------------+ | NULL | +------------+ 1 row in set (0.00 sec) '''
转载于:https://my.oschina.net/u/3323607/blog/2248111
最后
以上就是勤奋冰淇淋最近收集整理的关于mysql基础知识--状态查询的全部内容,更多相关mysql基础知识--状态查询内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复