How can I learn MySql version? [duplicate]
Possible Duplicate:
Which version is my MySQL Server?
As question indicates how can I learn my 'mysql' server's version by using terminal?
If you have the mysql client installed you can use that to connect to your database server and issue the following statement:
SELECT VERSION();
For example you could use this:
echo SELECT VERSION() | mysql -u foo ...other parameters here...
The result will look something like this:
VERSION() 5.1.41-community
The STATUS command displays the version as well as version comment information. For example:
mysql> STATUS;
Open up a terminal and type in mysql
. You should see something like this:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 205
Server version: 5.1.53 MySQL Community Server (GPL)
mysql -V
works too and outputs something like this:
/usr/local/mysql/bin/mysql Ver 14.14 Distrib 5.1.53, for apple-darwin10.3.0 (i386) using readline 5.1
There are a few ways to do that. You can do:
mysql> SELECT VERSION();
or
mysql> SELECT @@version;
or
mysql> STATUS;
If you have access to the terminal, you can check using:
mysql -V
精彩评论