有很多种方法可以知道mysql服务器的版本。

1、使用mysql客户端连接服务器,登录成功可以看到mysql服务器的版本。

[root@iZ94lykssym6sfds ~]$ mysql -utest -ptest
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 187317
Server version: 5.1.73-log Source distribution

2、使用函数

mysql> select version();
+------------+
| version() |
+------------+
| 5.1.73-log |
+------------+

3、使用show variables 查看变量

mysql> show variables like 'version';
+---------------+------------+
| Variable_name | Value |
+---------------+------------+
| version | 5.1.73-log |
+---------------+------------+

4、状态status命令

mysql> status
--------------
mysql Ver 14.14 Distrib 5.1.73, for redhat-linux-gnu (x86_64) using readline 5.1
Connection id: 187317
Current database:
Current user: wwh@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 5.1.73-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: /var/lib/mysql/mysql.sock
Uptime: 54 days 23 hours 57 min 2 sec
Threads: 9 Questions: 2844007 Slow queries: 0 Opens: 662 Flush tables: 2 Open tables: 52 Queries per second avg: 0.598
--------------

5、使用mysql -V