(links)-> (Parent)->find out version of mysql in linux machine via command line or query
submited by Russell Thu 19 Jan 06|
Edited Fri 30 Mar 12
In responce to: "
find out version of mysql in linux machine via command line"|
To get the version number from the command line use:
This is the version of the client you have installed. Typcialy the server and the client should be the same version. You can check all the files with the rpm command:
mysql Ver 11.18 Distrib 3.23.58, for redhat-linux-gnu (i386)
These commands should work on any rpm based product ( Redhat , Fedora Core 1,2,3,4 ... , RHEL 1,2,3,4 ... )
rpm -q --all |grep mysql
Another way to figure out the version of the server is to connect to it. ( this will work even if the server isn't local, so long as you have access)
The Version number of the server is displayed on the welcome message.
mysql -u username -h servername -p
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3491937 to server version: 3.23.58
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
Now if you want an application to be able to make choices based on the my sql version number you can also query the server for it's version number.
mysql> select version();
| version() |
| 5.0.86 |
1 row in set (0.00 sec)
Add comment or question...: