Documentation Home
MySQL 5.7 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 37.9Mb
PDF (A4) - 37.9Mb
PDF (RPM) - 36.5Mb
HTML Download (TGZ) - 9.9Mb
HTML Download (Zip) - 9.9Mb
HTML Download (RPM) - 8.7Mb
Man Pages (TGZ) - 209.5Kb
Man Pages (Zip) - 318.7Kb
Info (Gzip) - 3.5Mb
Info (Zip) - 3.5Mb
Excerpts from this Manual

MySQL 5.7 Reference Manual  /  ...  /  mysql_get_client_version()

27.8.7.28 mysql_get_client_version()

unsigned long mysql_get_client_version(void)

Description

Returns an integer that represents the MySQL client library version. The value has the format XYYZZ where X is the major version, YY is the release level (or minor version), and ZZ is the sub-version within the release level:

major_version*10000 + release_level*100 + sub_version

For example, "5.7.24" is returned as 50724.

The function value is the version of MySQL or Connector/C that provides the client library. For more information, see Section 27.8.4.5, “C API Server and Client Library Versions”.

Return Values

An integer that represents the MySQL client library version.

Errors

None.


User Comments
User comments in this section are, as the name implies, provided by MySQL users. The MySQL documentation team is not responsible for, nor do they endorse, any of the information provided here.
  Posted by SBF SBF on August 25, 2017
If you want to print it, you can use something like this:

unsigned long mysql_version = mysql_get_client_version();
std::cout << "\tMySQL V"
<< mysql_version / 10000 << "." // major
<< mysql_version / 100 % 100 << "." // minor
<< mysql_version % 100 << // build
<< std::endl;
Sign Up Login You must be logged in to post a comment.