2.9.9 MySQL Configuration and Third-Party Tools
Third-party tools that need to determine the MySQL version from the MySQL source can read the
VERSION file in the top-level source directory. The file lists the pieces of the version separately. For example, if the version is MySQL 5.7.4-m14, the file looks like this:
MYSQL_VERSION_MAJOR=5 MYSQL_VERSION_MINOR=7 MYSQL_VERSION_PATCH=4 MYSQL_VERSION_EXTRA=-m14
If the source is not for a General Availablility (GA) release, the
MYSQL_VERSION_EXTRA value will be nonempty. For the example, the value corresponds to Milestone 14.
To construct a five-digit number from the version components, use this formula:
MYSQL_VERSION_MAJOR*10000 + MYSQL_VERSION_MINOR*100 + MYSQL_VERSION_PATCH