Version vs Distrib number of MySQL

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)

Leave a Comment