linux下查看數據庫版本的5中方法


1.在Linux終端窗口中,輸入mysql -V查看MySQL版本信息
[sky@qin ~]# mysql -V
mysql  Ver 14.14 Distrib 5.1.29-rc, for pc-linux-gnu (i686) using readline 5.1

 

2.在Linux終端窗口中,輸入mysql --help | grep Distrib查看MySQL版本信息
[sky@qin ~]# mysql --help | grep Distrib
mysql  Ver 14.14 Distrib 5.1.29-rc, for pc-linux-gnu (i686) using readline 5.1

 

3.成功登錄MySQL數據庫即顯示MySQL版本信息
[sky@qin ~]# mysql -uroot -pxinwei
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 32652
Server version: 5.1.29-rc-log MySQL Community Server (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

 

//mysql命令行下的命令以分號(;)結束,遇到分號(;)即開始執行命令;
//connection id表示MySQL數據庫的連接次數;
//5.1.29-rc-log MySQL Community Server 表示該版本是社區版本;
//(GPL)表示該版本是遵循GPL協議的;
//輸入help;或者\h,能查看幫助信息;
//輸入\c,能清除緩存,緩存中包括了之前已輸入的命令;

 

4.登錄MySQL數據庫后,輸入status查看MySQL版本信息
mysql> status
--------------
mysql  Ver 14.14 Distrib 5.1.29-rc, for pc-linux-gnu (i686) using readline 5.1

Connection id:          32652
Current database:
Current user:           sky@localhost
SSL:                    Not in use
Current pager:          stdout
Using outfile:          ''
Using delimiter:        ;
Server version:         5.1.29-rc-log MySQL Community Server (GPL)
Protocol version:       10
Connection:             Localhost via UNIX socket
Server characterset:    utf8
Db     characterset:    utf8
Client characterset:    utf8
Conn.  characterset:    utf8
UNIX socket:            /usr/local/mysql/data/mysql.sock
Uptime:                 20 hours 37 min 24 sec

Threads: 8  Questions: 634045  Slow queries: 0  Opens: 13622  Flush tables: 1  Open tables: 64  Queries per second avg: 7.785
--------------

 

5.登錄MySQL數據庫后,使用MySQL系統函數查看MySQL版本信息
mysql> select version();
+---------------+
| version()     |
+---------------+
| 5.1.29-rc-log |
+---------------+
1 row in set (0.00 sec)

 

博文僅供學習交流,轉載請注明出處。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM