查看数据库 MySQL 的版本信息的命令语句
生活随笔
收集整理的這篇文章主要介紹了
查看数据库 MySQL 的版本信息的命令语句
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
文章目錄
- 一、mysql -V
- 二、登錄數據庫后會顯示版本信息
- 三、mysqladmin -uroot -p version
- 四、select version()
- 五、命令 status
- 六、show variables like '%version%'
一、mysql -V
[root@htlwk0001host ~]# mysql -V mysql Ver 14.14 Distrib 5.7.31, for Linux (x86_64) using EditLine wrapper注意:V 是大寫
二、登錄數據庫后會顯示版本信息
[root@htlwk0001host ~]# mysql -uroot -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 702 Server version: 5.7.31 MySQL Community Server (GPL)Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.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.如上所示 Server version: 5.7.31 MySQL Community Server (GPL) 這就是數據庫的版本信息
三、mysqladmin -uroot -p version
[root@htlwk0001host /]# mysqladmin -uroot -p version Enter password: mysqladmin Ver 8.42 Distrib 5.7.31, for Linux on x86_64 Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.Server version 5.7.31 Protocol version 10 Connection Localhost via UNIX socket UNIX socket /var/lib/mysql/mysql.sock Uptime: 1 day 5 hours 41 min 13 secThreads: 21 Questions: 12030 Slow queries: 0 Opens: 114 Flush tables: 1 Open tables: 107 Queries per second avg: 0.112四、select version()
查詢數據庫的版本號
mysql> select version(); +-----------+ | version() | +-----------+ | 5.7.31 | +-----------+ 1 row in set (0.00 sec)五、命令 status
mysql> status -------------- mysql Ver 14.14 Distrib 5.7.31, for Linux (x86_64) using EditLine wrapperConnection id: 1243 Current database: Current user: root@localhost SSL: Not in use Current pager: stdout Using outfile: '' Using delimiter: ; Server version: 5.7.31 MySQL Community Server (GPL) Protocol version: 10 Connection: Localhost via UNIX socket Server characterset: utf8mb4 Db characterset: utf8mb4 Client characterset: utf8mb4 Conn. characterset: utf8mb4 UNIX socket: /var/lib/mysql/mysql.sock Uptime: 1 day 6 hours 16 min 37 secThreads: 21 Questions: 12273 Slow queries: 0 Opens: 114 Flush tables: 1 Open tables: 107 Queries per second avg: 0.112 --------------六、show variables like ‘%version%’
mysql> show variables like '%version%'; +-------------------------+------------------------------+ | Variable_name | Value | +-------------------------+------------------------------+ | innodb_version | 5.7.31 | | protocol_version | 10 | | slave_type_conversions | | | tls_version | TLSv1,TLSv1.1,TLSv1.2 | | version | 5.7.31 | | version_comment | MySQL Community Server (GPL) | | version_compile_machine | x86_64 | | version_compile_os | Linux | +-------------------------+------------------------------+ 8 rows in set (0.00 sec)總結
以上是生活随笔為你收集整理的查看数据库 MySQL 的版本信息的命令语句的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 谷歌 Chrome 浏览器改进阅读模式:
- 下一篇: 苹果的小圆点在哪里设置