1:在终端下:mysql -V。 以下是代码片段:



[root@yutian01 ~]# mysql -v

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 11

Server version: 5.6.16-log Source distribution


Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights 


reserved.


Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.



2:在mysql中:mysql> status;

以下是代码片段:

mysql> status

--------------

mysql  Ver 14.14 Distrib 5.6.16, for Linux (x86_64) using  EditLine 


wrapper


Connection id:          11

Current database:

Current user:           root@localhost

SSL:                    Not in use

Current pager:          stdout

Using outfile:          ''

Using delimiter:        ;

Server version:         5.6.16-log Source distribution

Protocol version:       10

Connection:             Localhost via UNIX socket

Server characterset:    utf8

Db     characterset:    utf8

Client characterset:    utf8

Conn.  characterset:    utf8

UNIX socket:            /usr/local/mysql/mysqld.sock

Uptime:                 3 hours 1 min 17 sec


Threads: 1  Questions: 223  Slow queries: 0  Opens: 86  Flush tables: 9 


 Open tables: 3  Queries per second avg: 0.020

--------------



3:在help里面查找

以下是代码片段:

[root@yutian01 ~]# mysql --help | grep Distrib

mysql  Ver 14.14 Distrib 5.6.16, for Linux (x86_64) using  EditLine 


wrapper



4:使用mysql的函数

以下是代码片段:

mysql> select version();

+------------+

| version()  |

+------------+

| 5.6.16-log |

+------------+

1 row in set (0.00 sec)