To obtain a Connector/C++ source distribution, visit the Connector/C++ downloads page. Alternatively, clone the Connector/C++ Git source repository.
A Connector/C++ source distribution is packaged as a compressed
tar file or Zip archive, denoted here as
source distribution in tar file or Zip archive
format can be used on any supported platform.
The distribution when unpacked includes an
INFO_SRC file that provides information about
the product version and the source repository from which the
distribution was produced. The distribution also includes other
documentation files such as those listed in
Chapter 3, Installing Connector/C++ from a Binary Distribution.
To unpack a compressed tar file, use this command in the intended installation directory:
tar zxvf PACKAGE.tar.gz
After unpacking the distribution, build it using the appropriate instructions for your platform later in this chapter.
To install from a Zip archive package (
file), use WinZip or another tool that can read
.zip files to unpack the file into the
location of your choosing. After unpacking the distribution, build
it using the appropriate instructions for your platform later in
To clone the Connector/C++ code from the source code repository located on GitHub at https://github.com/mysql/mysql-connector-cpp, use this command:
git clone https://github.com/mysql/mysql-connector-cpp.git
That command should create a
mysql-connector-cpp directory containing a
copy of the entire Connector/C++ source tree.
The git clone command sets the sources to the
master branch, which is the branch that
contains the latest sources. Released code is in the
8.0 branche (the
contains the same sources as the
branch). If necessary, use git checkout in the
source directory to select the desired branch. For example, to
build Connector/C++ 8.0:
cd mysql-connector-cpp git checkout 8.0
After cloning the repository, build it using the appropriate instructions for your platform later in this chapter.
After the initial checkout operation to get the source tree, run git pull periodically to update your source to the latest version.