本文小编为大家详细介绍“MySQL查看版本的方法有哪些”,内容详细,步骤清晰,细节处理妥当,希望这篇“Mysql查看版本的方法有哪些”文章能帮助大家解决疑惑,下面跟着小编的思路慢慢深入,一起来学习新知识吧。方法一:登录 mysql每次通过
本文小编为大家详细介绍“MySQL查看版本的方法有哪些”,内容详细,步骤清晰,细节处理妥当,希望这篇“Mysql查看版本的方法有哪些”文章能帮助大家解决疑惑,下面跟着小编的思路慢慢深入,一起来学习新知识吧。
每次通过 mysql 客户端连接服务器之后,都会显示一个欢迎信息,里面包含了服务器的版本:
mysql -urootEnter passWord: ******Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 21Server version: 8.0.32 MySQL CommUnity Server - GPLCopyright (c) 2000, 2022, oracle and/or its affiliates.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 全局变量 @@version 存储了服务器的版本号,我们可以利用一个简单的 SELECT 语句查询其中的信息。例如:
SELECT @@version;
查询结果示例如下:
+-----------+
| @@version |
+-----------+
| 8.0.32 |
+-----------+
系统函数 VERSION() 也可以返回 MySQL 服务器的版本信息,例如:
SELECT VERSION();+-----------+| VERSION() |+-----------+| 8.0.32 |+-----------+
SHOW VARIABLES 语句可以返回 MySQL 系统变量。通过添加 WHERE 条件,我们可以获取服务器的版本信息:
SHOW VARIABLESWHERE variable_name LIKE 'version%';+--------------------------+-----------------------------+| Variable_name | Value |+--------------------------+-----------------------------+| version | 8.0.32 || version_comment | MySQL Community Server - GPL|| version_compile_Machine | x86_64 || version_compile_os | Win64 || version_compile_zlib | 1.2.11 |+--------------------------+-----------------+
连接到 MySQL 服务器之后,输入 STATUS 命令可以返回版本和其他信息:
STATUS;
返回结果示例如下:
--------------
C:\Program Files\MySQL\MySQL Server 8.0\bin\mysql.exe Ver 8.0.32 for Win64 on x86_64 (MySQL Community Server - GPL)Connection id: 21
Current database:
Current user: root@localhost
SSL: Cipher in use is TLS_AES_256_GCM_SHA384
Using delimiter: ;
Server version: 8.0.32 MySQL Community Server - GPL
Protocol version: 10
Connection: localhost via tcp/IP
Server characterset: utf8mb4
Db characterset: utf8mb4
Client characterset: gbk
Conn. characterset: gbk
TCP port: 3306
Binary data as: Hexadecimal
Uptime: 12 days 10 hours 10 min 48 secThreads: 2 Questions: 443 Slow queries: 0 Opens: 350 Flush tables: 3 Open tables: 251 Queries per second avg: 0.000
--------------
读到这里,这篇“MySQL查看版本的方法有哪些”文章已经介绍完毕,想要掌握这篇文章的知识点还需要大家自己动手实践使用过才能领会,如果想了解更多相关内容的文章,欢迎关注编程网数据库频道。
--结束END--
本文标题: MySQL查看版本的方法有哪些
本文链接: https://www.lsjlt.com/news/350233.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-05-08
2024-05-08
2024-05-08
2024-05-08
2024-05-08
2024-05-08
2024-05-08
2024-05-08
2024-05-08
2024-05-08
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0