查看mysql数据库的版本方法
查看mysql数据库版本方法总结
当你接手某个mysql数据库管理时,首先你需要查看维护的mysql数据库版本;当开发人员问你mysql数据库版本时,而恰好你又遗忘了,那么此时也需要去查看mysql数据库的版本..............。下文总结一下Linux平台下查看mysql数据库的方法.个人觉得总结的比较全面了。
方法1:登录数据库时,你可以看到对应mysql数据库的版本信息,如下所示:
[root@DB-Server ~]# mysql -u root -pEnter password: Welcome to the MySQL monitor. Commands end with ; or\g.Your
MySQL connection id is 3Server version: 5.6.19 MySQL Community Server (GPL) Copyright (c) 2000, 2014, Oracle and/or its
affiliates. All rights reserved. Oracle is a registered trademark of Oracle
Corporation and/or itsaffiliates. Other names may be trademarks of their
respectiveowners. Type 'help;' or'\h' for help.
Type '\c' to clear the current input statement. mysql>
方法二:使用系统函数查看mysql数据库版本。
mysql> select version();+-----------+| version() |+-----------+| 5.6.19 |+-----------+1 row in set (0.00
sec) mysql> select @@version;+-----------+| @@version |+-----------+| 5.6.19 |+-----------+1 row in set(0.00
sec) mysql>
方法3:使用status命令查看,如下所示,查看Server version后内容。
mysql> status--------------mysql Ver 14.14 Distrib 5.6.19, for Linux (x86_64) using EditLine wrapper Connection id:
3Current database:Current user:
root@localhostSSL: Not in useCurrent pager:
stdoutUsing outfile: ''Using delimiter: ;Server version: 5.6.19
MySQL Community Server (GPL)Protocol version: 10Connection: Localhost via UNIX socketServer characterset: latin1Db characterset: latin1Client characterset: utf8Conn. characterset: utf8UNIX socket:
/var/lib/mysql/mysql.sockUptime: 2 hours 33 min 14 sec Threads: 1 Questions: 22 Slow queries: 0 Opens: 67 Flush tables: 1 Open tables:
60 Queries per secondavg: 0.002--------------
方法4:使用mysql -V命令查看
[root@DB-Server ~]# mysql -V
mysql Ver 14.14 Distrib 5.6.19, for Linux (x86_64) using EditLine wrapper
[root@DB-Server ~]# mysql --version
mysql Ver 14.14 Distrib 5.6.19, for Linux (x86_64) using EditLine wrapper
方法5:在mysql --help命令内容中查找
[root@DB-Server ~]# mysql --help | grep Distrib
mysql Ver 14.14 Distrib 5.6.19, for Linux (x86_64) using EditLine wrapper
方法6:通过rpm命令查看安装包得知mysql数据库版本
[root@DB-Server ~]# rpm -qa | grep -i mysql
MySQL-client-5.6.19-1.rhel5
MySQL-server-5.6.19-1.rhel5
[root@DB-Server ~]#
方法7:SHOW VARIABLES 命令查看
mysql> SHOW VARIABLES LIKE "%version%";+-------------------------+------------------------------+| Variable_name | Value |+-------------------------+------------------------------+|
innodb_version | 5.6.19 || protocol_version | 10 || slave_type_conversions | || version | 5.6.19 || version_comment | MySQL Community Server (GPL) || version_compile_machine | x86_64 || version_compile_os | Linux |+-------------------------+------------------------------+7 rows in set (0.00
sec) mysql>
方法8: mysqladmin -uroot -p -hlocalhost version 命令查看mysql数据库版本。其实这个方法也可以归为方法1
[root@DB-Server ~]# mysqladmin -uroot -p -hlocalhost version;Enter password: mysqladmin Ver 8.42 Distrib 5.6.19, for Linux on
x86_64Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners. Server version 5.6.19Protocol version 10Connection
Localhost via UNIX socketUNIX socket /var/lib/mysql/mysql.sockUptime: 2 hours 57 min 53 sec Threads: 1 Questions: 42 Slow queries: 0 Opens: 67 Flush tables: 1 Open tables: 60 Queries per second avg: 0.003
参考资料:
http://dev.mysql.com/doc/refman/5.0/en/installation-version.html
http://www.cnblogs.com/end/archive/2011/10/18/2216461.html
查看mysql数据库版本方法总结
2014-07-24 17:48 by 潇湘隐者, 12972 阅读, 7 评论, 收藏, 编辑
当你接手某个mysql数据库管理时,首先你需要查看维护的mysql数据库版本;当开发人员问你mysql数据库版本时,而恰好你又遗忘了,那么此时也需要去查看mysql数据库的版本..............。下文总结一下Linux平台下查看mysql数据库的方法.个人觉得总结的比较全面了。
方法1:登录数据库时,你可以看到对应mysql数据库的版本信息,如下所示:
[root@DB-Server ~]# mysql -u root -pEnter password: Welcome to the MySQL monitor. Commands end with ; or\g.Your
MySQL connection id is 3Server version: 5.6.19 MySQL Community Server (GPL) Copyright (c) 2000, 2014, Oracle and/or its
affiliates. All rights reserved. Oracle is a registered trademark of Oracle
Corporation and/or itsaffiliates. Other names may be trademarks of their
respectiveowners. Type 'help;' or'\h' for help.
Type '\c' to clear the current input statement. mysql>
方法二:使用系统函数查看mysql数据库版本。
mysql> select version();+-----------+| version() |+-----------+| 5.6.19 |+-----------+1 row in set (0.00
sec) mysql> select @@version;+-----------+| @@version |+-----------+| 5.6.19 |+-----------+1 row in set(0.00
sec) mysql>
方法3:使用status命令查看,如下所示,查看Server version后内容。
mysql> status--------------mysql Ver 14.14 Distrib 5.6.19, for Linux (x86_64) using EditLine wrapper Connection id:
3Current database:Current user:
root@localhostSSL: Not in useCurrent pager:
stdoutUsing outfile: ''Using delimiter: ;Server version: 5.6.19
MySQL Community Server (GPL)Protocol version: 10Connection: Localhost via UNIX socketServer characterset: latin1Db characterset: latin1Client characterset: utf8Conn. characterset: utf8UNIX socket:
/var/lib/mysql/mysql.sockUptime: 2 hours 33 min 14 sec Threads: 1 Questions: 22 Slow queries: 0 Opens: 67 Flush tables: 1 Open tables:
60 Queries per secondavg: 0.002--------------
方法4:使用mysql -V命令查看
[root@DB-Server ~]# mysql -V
mysql Ver 14.14 Distrib 5.6.19, for Linux (x86_64) using EditLine wrapper
[root@DB-Server ~]# mysql --version
mysql Ver 14.14 Distrib 5.6.19, for Linux (x86_64) using EditLine wrapper
方法5:在mysql --help命令内容中查找
[root@DB-Server ~]# mysql --help | grep Distrib
mysql Ver 14.14 Distrib 5.6.19, for Linux (x86_64) using EditLine wrapper
方法6:通过rpm命令查看安装包得知mysql数据库版本
[root@DB-Server ~]# rpm -qa | grep -i mysql
MySQL-client-5.6.19-1.rhel5
MySQL-server-5.6.19-1.rhel5
[root@DB-Server ~]#
方法7:SHOW VARIABLES 命令查看
mysql> SHOW VARIABLES LIKE "%version%";+-------------------------+------------------------------+| Variable_name | Value |+-------------------------+------------------------------+|
innodb_version | 5.6.19 || protocol_version | 10 || slave_type_conversions | || version | 5.6.19 || version_comment | MySQL Community Server (GPL) || version_compile_machine | x86_64 || version_compile_os | Linux |+-------------------------+------------------------------+7 rows in set (0.00
sec) mysql>
方法8: mysqladmin -uroot -p -hlocalhost version 命令查看mysql数据库版本。其实这个方法也可以归为方法1
[root@DB-Server ~]# mysqladmin -uroot -p -hlocalhost version;Enter password: mysqladmin Ver 8.42 Distrib 5.6.19, for Linux on
x86_64Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners. Server version 5.6.19Protocol version 10Connection
Localhost via UNIX socketUNIX socket /var/lib/mysql/mysql.sockUptime: 2 hours 57 min 53 sec Threads: 1 Questions: 42 Slow queries: 0 Opens: 67 Flush tables: 1 Open tables: 60 Queries per second avg: 0.003
参考资料:
http://dev.mysql.com/doc/refman/5.0/en/installation-version.html
http://www.cnblogs.com/end/archive/2011/10/18/2216461.html