查看MySQL的版本信息
2023-05-07 本文已影响0人
Jerry_1116
0 环境信息
- 操作系统:Linux version 3.10.0-957.el7.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-36) (GCC) ) #1 SMP Thu Nov 8 23:39:32 UTC 2018
- MySQL: Docker部署,Ver 8.0.28 for Linux on x86_64 (MySQL Community Server - GPL)
1 命令行查看mysql -V
$ mysql -V
mysql Ver 8.0.28 for Linux on x86_64 (MySQL Community Server - GPL)
2 命令行查看mysql --version
$ mysql --version
mysql Ver 8.0.28 for Linux on x86_64 (MySQL Community Server - GPL)
3 命令行查看筛选
$ mysql --help | grep "Ver "
mysql Ver 8.0.28 for Linux on x86_64 (MySQL Community Server - GPL)
4 SQL语句select version()
mysql> select version();
+-----------+
| version() |
+-----------+
| 8.0.28 |
+-----------+
1 row in set (0.00 sec)
5 SQL语句status
或者\s
mysql> status
--------------
mysql Ver 8.0.28 for Linux on x86_64 (MySQL Community Server - GPL)
Connection id: 620
Current database:
Current user: root@172.17.0.4
SSL: Cipher in use is TLS_AES_256_GCM_SHA384
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 8.0.28 MySQL Community Server - GPL
Protocol version: 10
Connection: 172.17.0.2 via TCP/IP
Server characterset: utf8mb4
Db characterset: utf8mb4
Client characterset: latin1
Conn. characterset: latin1
TCP port: 3306
Binary data as: Hexadecimal
Uptime: 390 days 23 hours 24 min 14 sec
Threads: 2 Questions: 1522 Slow queries: 0 Opens: 518 Flush tables: 3 Open tables: 437 Queries per second avg: 0.000
--------------
6 mysql客户端连接mysql server的时候显示版本信息
$ docker run -it --rm mysql mysql -h172.17.0.2 -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 620
Server version: 8.0.28 MySQL Community Server - GPL
Copyright (c) 2000, 2022, Oracle and/or its affiliates.
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.