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
or
PACKAGE
.tar.gz
. A
source distribution in tar file or Zip archive
format can be used on any supported platform.
PACKAGE
.zip
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 (.zip
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
this chapter.
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
and 1.1
branches (the
8.0
branch contains the same sources as the
master
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
Or to build Connector/C++ 1.1:
cd mysql-connector-cpp
git checkout 1.1
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.