check mysql version_How To Check The MySQL Version In Linux

Introduction

It is essential to know which version of MySQL you have installed.

Knowing the version number helps to determine if a specific feature is available or compatible with your system. This article provides five options to check your version of MySQL on Linux operating systems.

知道版本号有助于确定特定功能是否可用或与您的系统兼容。本文提供了五个选项来检查Linux操作系统上的MySQL版本

6776ab58000f184b6fa8d201382476ec.png

Prerequisites

先决条件

Access to the command line/terminal window

进入命令行/终端窗口

Some operations require sudo or root privileges

某些操作需要sudo或root特权

MySQL or MySQL fork installed (forks: MariaDB, Percona Server )

安装了MySQL或MySQL分支(分支:MariaDB,Percona Server)

Check MySQL Version with V Command

使用V命令检查MySQL版本

The easiest way to find the MySQL version is with the command:

发现MySQL版本的最简单方法是使用以下命令:

mysql -V

The command mysql –V is not OS specific. This command works on Windows, OS X, and Linux distributions including Ubuntu.

命令mysql –V不是特定于操作系统的。该命令可在Windows,OS X和Linux发行版(包括Ubuntu)上使用

0690a3159da17057489e42e7d9e12f25.png

The MySQL client version in the example above is 10.4.5-MariaDB.

Note: The command provides the version of the MySQL client utility. The version could be the same as the MySQL server utility if installed on the same system as the server. However, if the client and server utilities are installed on different systems, they might not be the same.

注意:该命令提供了MySQL客户端实用程序的版本。如果与服务器安装在同一系统上,则该版本可能与MySQL服务器实用程序相同。但是,如果客户端和服务器实用程序安装在不同的系统上,则它们可能会不同

How to Find Version Number with mysql Command

如何使用mysql命令发现版本号

The MySQL command-line client is a simple SQL shell with input editing capabilities. You need to have administrative privileges or use the sudo command to gain access.

MySQL命令行客户端是具有输入编辑功能的简单SQL Shell。您需要具有管理特权或使用sudo命令来获得访问权限

To access your MySQL client, use the command:

要访问您的MySQL客户端,请使用以下命令:

mysql

MySQL version data is available automatically once the MySQL client loads.

MySQL客户端加载后,MySQL版本数据将自动可用

9573efd2d69d4578cca8621c19a2e1e2.png

The MySQL client shell offers a lot more options to retrieve detailed information about the version installed.

MySQL客户端shell提供了更多选项来检索有关已安装版本的详细信息

SHOW VARIABLES LIKE Statement

Now that you have accessed the MySQL client shell, statements can provide detailed information about your MySQL installation. Keep in mind that all text commands within the MySQL client must end with a semicolon “;”

现在,您已经访问了MySQL客户端外壳,语句可以提供有关MySQL安装的详细信息。请记住,MySQL客户端中的所有文本命令都必须以分号“;”结尾

Enter the following command:

SHOW VARIABLES LIKE ‘%version%’;

d159c4b19d6020e3baee64d3740f33e7.png

The variable that contains MySQL version information is version.

包含MySQL版本信息的变量是version

SELECT VERSION Statement

It’s possible to obtain the version from within the MYSQL client by typing the SELECT VERSION() statement:

通过键入SELECT VERSION()语句,可以从MYSQL客户端中获取版本:

SELECT VERSION();

61f0b07c9deb63339c4bcc15ddc2b67e.png

This command derives the data from the version variable disregarding other variables.

该命令从版本变量派生数据,而不考虑其它变量

STATUS Command

The STATUS command displays the version as well as version comment information:

STATUS命令显示版本以及版本注释信息:

STATUS;

The output includes uptime (how long the MySQL server has been running), threads (the number of active threads), and other useful information

输出包括正常运行时间(MySQL服务器已运行多长时间),线程(活动线程数)和其他有用的信息

7a9ad2dde1a872684f912d9ac582844a.png

This statement provides the most comprehensive overview regarding the status of the MySQL installation and its current version.

该语句提供有关MySQL安装状态及其当前版本的最全面的概述

Conclusion

You now know how to use the command line to check your MySQL version. Additionally, if you need to get a more detailed account of your MySQL version, this article explained how to display additional data from within the MySQL client.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值