如何檢視MySQL的版本?
原文地址:http://blog.csdn.net/lamp_yang_3533/article/details/52266320
檢視MySQL的版本,主要有以下幾個方法:
1. 沒有連線到MySQL伺服器,就想檢視MySQL的版本。開啟cmd,切換至mysql的bin目錄,執行下面的命令即可:
e:\mysql\bin>mysql -V
mysql Ver 14.14 Distrib 5.6.32, for Win32 (AMD64)
(版本為 5.6.32)
或者:
e:\mysql\bin>mysql -v
這個命令可以檢視到更為詳細的資訊,因為它會用賬號 ODBC,連線上MySQL伺服器,預設連線到localhost上的3306埠。
或者:
e:\mysql\bin>mysql --help | find "Distrib"
mysql Ver 14.14 Distrib 5.6.32, for Win32 (AMD64)
這種方式只有windows系統下才可用,因為windows中才用find命令查詢字串,且後面的字串必須用雙引號包裹起來,而linux系統下雖然也是用 | 作為管道符,卻是使用grep命令查詢字串(如:mysql --help | grep Distrib)。
2. 如果已經連線到了MySQL伺服器,則執行下面的命令:
mysql> select version();
+------------+
| version() |
+------------+
| 5.6.32-log |
+------------+
1 row in set (0.00 sec)
或者:
mysql> status;
--------------
mysql Ver 14.14 Distrib 5.6.32, for Win32 (AMD64)
Connection id: 9
Current database:
Current user: [email protected]
SSL: Not in use
Using delimiter: ;
Server version: 5.6.32-log MySQL Community Server (GPL)
Protocol version: 10
Connection: localhost via TCP/IP
Server characterset: latin1
Db characterset: latin1
Client characterset: gbk
Conn. characterset: gbk
TCP port: 3307
Uptime: 4 hours 7 min 11 sec
Threads: 4 Questions: 126 Slow queries: 0 Opens: 73 Flush tables: 1 Open tables: 66 Queries per second avg: 0.008
或者:
mysql> \s
--------------
mysql Ver 14.14 Distrib 5.6.32, for Win32 (AMD64)
Connection id: 9
Current database:
Current user: [email protected]
SSL: Not in use
Using delimiter: ;
Server version: 5.6.32-log MySQL Community Server (GPL)
Protocol version: 10
Connection: localhost via TCP/IP
Server characterset: latin1
Db characterset: latin1
Client characterset: gbk
Conn. characterset: gbk
TCP port: 3307
Uptime: 4 hours 9 min 29 sec
Threads: 4 Questions: 144 Slow queries: 0 Opens: 73 Flush tables: 1 Open tables: 66 Queries per second avg: 0.009
3. 在命令列連線上MySQL伺服器時,其實就已經顯示了MySQL的版本,如:
e:\mysql\bin>mysql -uroot -p -P3307
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 5.6.32-log MySQL Community Server (GPL)
Copyright (c) 2000, 2016, 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.
--------------------- 本文來自 竹林幽深 的CSDN 部落格 ,全文地址請點選:https://blog.csdn.net/xiyang_1990/article/details/55803516?utm_source=copy