Friday, February 14, 2014

How to Find mysql version

Many times we come across to find the exact version of our running mysql instance and want to know the what is running out there so we can probably plan for upgrade and patches.

you can find the version in the following places

1:- the mysql log file , usually if you have a standard installation it should be at ‘/var/log/mysqld.log’, run the following command on the bash prompt
grep Version /var/log/mysqld.log

you should see something like this :
Version: ‘5.1.30-log’ socket: ‘/var/lib/mysql/mysql.sock’ port: 3306 MySQL Community Server (GPL)

2:- you can also issue mysql statement to find the mysql version on a running instance
mysql -e “status” | grep “Server version”

will output
5.1.30-log MySQL Community Server (GPL)

3:- you can also execute mysql statement “select version()” to find the current running version
mysql -e “select version();”

will output
| version() |
| 5.1.30-log |

in the above snippet, the version is 5.1.30 with bin-log enabled and is “MySQL Community Server (GPL)”, the version number will differ based on your installation.

No comments:

Post a Comment

About Me

My photo
Greetings Friend! I am Linux scholar, trying to learn as much I can and share it with you. I am in mid of my Professional Career. Doing Good. :)