首页 > 代码库 > mysql 查看mysql版本的四种方法

mysql 查看mysql版本的四种方法

   1 命令行中使用status可以查看。

    mysql> status;
--------------
mysql  Ver 14.14 Distrib 5.5.25a, for Linux (x86_64) using readline 5.1

Connection id:          33348
Current database:
Current user:           root@localhost
SSL:                    Not in use
Current pager:          stdout
Using outfile:          ‘‘
Using delimiter:        ;
Server version:         5.5.25a-log MySQL Community Server (GPL)
Protocol version:       10
Connection:             Localhost via UNIX socket
Server characterset:    latin1
Db     characterset:    latin1
Client characterset:    utf8
Conn.  characterset:    utf8
UNIX socket:            /var/lib/mysql/mysql.sock
Uptime:                 9 days 20 hours 42 min 23 sec

Threads: 14  Questions: 7724060  Slow queries: 0  Opens: 532  Flush tables: 1  Open tables: 237  Queries per second avg: 9.064
--------------

2. 使用系统函数

mysql> select version();
+-------------+
| version()   |
+-------------+
| 5.5.25a-log |
+-------------+
1 row in set (0.01 sec)

3. 使用命令

  mysql --help | grep Distrib
mysql  Ver 14.14 Distrib 5.5.25a, for Linux (x86_64) using readline 5.1

4. 在终端使用、

mysql -V
mysql  Ver 14.14 Distrib 5.5.25a, for Linux (x86_64) using readline 5.1