Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Version vs Distrib number of MySQL

Tags:

mysql

Typing the

mysql --version 

command in a Linux shell, I got the following:

mysql  Ver 14.12 Distrib 5.0.77, for redhat-linux-gnu (i686) using readline 5.1 

The number 5.0.77 obviously refers to the known version number of MySQL. What does 14.12 mean?

Is this documented/explained anywhere?

like image 846
smbatpetrosyan Avatar asked Dec 27 '11 13:12

smbatpetrosyan


People also ask

How do I find MySQL version number?

To check the version your MySQL is running, type and execute mysql -V (note the uppercase V) in the command line. As you can see, the MySQL version for this system is 10.4. 12.

What are the different versions of MySQL?

MySQL is offered under two different editions: the open source MySQL Community Server and the proprietary Enterprise Server.

Which version of MySQL should I use?

We recommend using the most recent GA release. The naming scheme in MySQL 5.6 uses release names that consist of three numbers and an optional suffix; for example, mysql-5.6.


1 Answers

Ver refers to the version of the mysql command line client - what you are envoking by typing 'mysql'
Distrib refers to the mysql server version your client was built with. This is not to be confused with the mysql server you are connected to, which can be obtained with SELECT VERSION();

The mysql client (what you are evoking) is distributed with the server, and, AFAIK, there is no easy way to build it on it's own.

I can't find any documentation for this either, so the source is the only 'source' of documentation.

First stop: client/mysql.cc: the mysql client.

    static void usage(int version)     {     ...     printf("%s  Ver %s Distrib %s, for %s (%s) using %s %s\n",              my_progname, VER, MYSQL_SERVER_VERSION, SYSTEM_TYPE, MACHINE_TYPE,              readline, rl_library_version); 

As you see, it uses the constants VER for "14.12" and MYSQL_SERVER_VERSION for "5.0.77"

Where are these constants defined?, is the question.

VER is defined near the top (line 51 in my source) of client/mysql.cc as a constant at run time.

const char *VER= "14.14";  

And I would assume, updated by hand or by a checkin process. This is very likely the version of the 'client' because it's right there in the client code.

MYSQL_SERVER_VERSION is defined in include/mysql_version.h (line 12) which is used for both the client and server (mysql / mysqld)

#define MYSQL_SERVER_VERSION            "5.1.56" 

(it's actually set in the configure script and substituted in at configure time)

like image 141
FlipMcF Avatar answered Sep 28 '22 01:09

FlipMcF