When you take over a MySQL database management, you first need to look at the version of the MySQL database that you maintain, and when the developer asks you about the MySQL database version, and you forget it, you also need to look at the MySQL database version ... The following is a summary of how the MySQL database is viewed under the Linux platform. The individual feels that the summary is more comprehensive.
Method 1: When you log in to the database, you can see the version information corresponding to the MySQL database as follows:
[Email protected] ~]# mysql-u root-p
To the MySQL Monitor. or \g.
is 3
Server version:5.6.19 MySQL Community Server (GPL)
and/allrights reserved.
and/or its
of their respective
Owners.
Statement.
Method Two: Use the system functions to view the MySQL database version.
Select version ();
+-----------+
| Version () |
+-----------+
| 5.6.19 |
+-----------+
Set (0.00 sec)
SELECT @ @version;
+-----------+
@ @version |
+-----------+
| 5.6.19 |
+-----------+
Set (0.00 sec)
Method 3: Use the status command to view the content after the 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
Database
User: [email protected]
SSL: 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 Sockets: /var/lib/mysql/mysql.sock
Uptime: min sec
Threads:1 questions:22 Slow queries:0 opens:67 Flush tables:1 Open tables:60 avg:0.002
--------------
Method 4: Use the MYSQL-V command to view
[Email protected] ~]# mysql-v
MySQL Ver 14.14 distrib 5.6.19, for Linux (x86_64) using Editline Wrapper
[[email protected] ~]# MySQL--version
MySQL Ver 14.14 distrib 5.6.19, for Linux (x86_64) using Editline Wrapper
Method 5: Look in the MySQL--help command content
[[email protected] ~]# MySQL--help | grep distrib
MySQL Ver 14.14 distrib 5.6.19, for Linux (x86_64) using Editline Wrapper
Method 6: View the installation package with the RPM command to know the MySQL database version
[Email protected] ~]# Rpm-qa | Grep-i MySQL
Mysql-client-5.6.19-1.rhel5
Mysql-server-5.6.19-1.rhel5
[Email protected] ~]#
Method 7:show VARIABLES Command View
Like "%version%";
+-------------------------+------------------------------+
| Variable_name Value |
+-------------------------+------------------------------+
| Innodb_version | 5.6.19 |
| Protocol_version |
| Slave_type_conversions | |
| Version | 5.6.19 |
| Version_comment | MySQL Community Server (GPL) |
| Version_compile_machine | x86_64 |
| Version_compile_os | Linux |
+-------------------------+------------------------------+
Set (0.00 sec)
Method 8:mysqladmin-uroot-p the-hlocalhost version command to view the MySQL database versions. In fact, this method can also be classified as Method 1
[[Email protected] ~] # mysqladmin-uroot-p-hlocalhost version;
Mysqladmin for Linux on x86_64
Copyright (c), the Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of the Oracle Corporation and/or its
Affiliates. Other names 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 min. sec
Threads:1 questions:42 Slow queries:0 opens:67 Flush tables:1 Open tables:60 queries per se Cond avg:0.003
Review MySQL database version method summary