View mysql database version summary, mysql database
When you take over the management of a mysql database, you first need to check the maintained mysql database version. When a developer asks you about the mysql database version, you forget it again, now you need to view the mysql database version ............... The following describes how to view mysql databases on the Linux platform. I personally think the summary is comprehensive.
Method 1:When logging on to the database, you can see the version information of the corresponding mysql database, as shown below:
[root@DB-Server ~]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server 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 its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
Method 2: Use System functions to view the mysql database version.
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>
Method 3: Use the status command to view the content after Server version, as shown below.
mysql> status
--------------
mysql Ver 14.14 Distrib 5.6.19, for Linux (x86_64) using EditLine wrapper
Connection id: 3
Current database:
Current user: root@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 5.6.19 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: 2 hours 33 min 14 sec
Threads: 1 Questions: 22 Slow queries: 0 Opens: 67 Flush tables: 1 Open tables: 60 Queries per second avg: 0.002
--------------
Method 4: Use the mysql-V command to view
[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
Method 5: Search for the mysql -- help Command
[Root @ DB-Server ~] # Mysql -- help | grep Distrib
Mysql Ver 14.14 Distrib 5.6.19, for Linux (x86_64) using EditLine wrapper
Method 6: run the rpm command to view the installation package and obtain the mysql database version.
[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 ~] #
Method 7: View 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>
Method 8: run the mysqladmin-uroot-p-hlocalhost version command to view the mysql database version. In fact, this method can also be classified as method 1.
[root@DB-Server ~]# mysqladmin -uroot -p -hlocalhost version;
Enter password:
mysqladmin Ver 8.42 Distrib 5.6.19, for Linux on x86_64
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.
Server version 5.6.19
Protocol version 10
Connection Localhost via UNIX socket
UNIX socket /var/lib/mysql/mysql.sock
Uptime: 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
References:
Http://dev.mysql.com/doc/refman/5.0/en/installation-version.html
Http://www.cnblogs.com/end/archive/2011/10/18/2216461.html
How can I view the MySQL database version number?
Enter mysql and enter \ s to view the version information. Good, 14:59:43
How to view the mysql database version in linux
Mysql -- version