Archive - Originally posted on "The Horse's Mouth" - 2009-09-26 20:59:31 - Graham Ellis
Oh be careful - that is a VERY dangerous question. Do you mean "what version is my MySQL server" or "what version of the mysql client program am I running?" I'll show you how to find answers to both questions.
What version is my MySQL server?
Use the select command, and run the version function within it:
mysql> select version();
+-------------+
| version() |
+-------------+
| 5.0.51a-log |
+-------------+
1 row in set (0.02 sec)
Your MySQL server is the program that's know as mysqldand is run as a daemon (linux / unix term) or service (Windows term). It may be run directly, or instigated via a scripts such as mysqld_safe or safe_mysqld
What version of the mysql client am I running?
Simply run the mysql client with the -V (that's a capital V) option:
-bash-3.2$ mysql -V
mysql Ver 14.12 Distrib 5.0.45,
for redhat-linux-gnu (i386) using readline 5.0
-bash-3.2$
The mysql client program is a small utility that lets you type in SQL commands at the keyboard and have them routed to the mysql server, and then handles and displays the results. It's ironic that the program that bears the name of the product (mysql) is such a tiny part of the whole!