How to query the database version in mysql

WBOY
Release: 2022-05-19 16:14:15
Original
39707 people have browsed it

Method: 1. Use the "select version();" statement to query; 2. Use the "show variables like '%version%'" statement to query; 3. Use the "status" command in the mysql client to query ;4. Use "mysql -V" to query in the terminal.

How to query the database version in mysql

The operating environment of this tutorial: linux7.3 system, mysql8.0.22 version, Dell G3 computer.

How to query the database version with mysql

1. Use MySQL function:

select version();
Copy after login

2. Use MySQL variable:

show variables like ‘%version%’
Copy after login

3. MySQL client command: status (abbreviated as \s)

status (\s) command is the simplest, but it can only be used in the MySQL command line client. Execute

4 in the client (MySQL Command Line Client), the parameter is -V (capital letters) or --version

Usage method:

mysql -V
Copy after login

Or

mysql --version
Copy after login

Disadvantages can only be executed on the server where Mysql is installed

Extended knowledge:

1. Log in to mysql using the terminal command – u root -p, the login log also contains the version number

Disadvantages need to reconnect and log in

2. Enter rpm -qa | grep mysql

at the terminal. This is It is used to check the version number of the mysql installation package. In fact, it is useless to see the version number of the installation package.

Recommended learning:mysql video tutorial

The above is the detailed content of How to query the database version in mysql. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!