MySQL Connector/C Developer Guide

4.1 Installing Connector/C from a Binary Distribution

Installers in native package formats are available for many Unix and Unix-like systems, and for Windows. Alternatively, you can install using a distribution in a more generic format such as a Zip archive or compressed tar file.

You may need to have root or administrator privileges to perform the installation operation.

Installing Connector/C on Unix Using Compressed tar Files

On Unix and Unix-like systems, a generic Connector/C binary distribution is packaged as a compressed tar file, denoted here as PACKAGE.tar.gz. To install a distribution file, unpack it in the intended installation directory using this command:

shell> tar zxvf PACKAGE.tar.gz

Installing Connector/C on Microsoft Windows


MySQL Connector/C Community requires the Visual C++ Redistributable for Visual Studio 2015 (available at the Microsoft Download Center) to work on Windows platforms; install it before installing MySQL Connector/C Community.

The simplest and recommended method for installing Connector/C on Windows platforms is to download MySQL Installer and let it install and configure all the MySQL products on your system. See MySQL Installer for Windows for details. Those who are not using the MySQL Installer can choose between two binary distributions:

Installing Connector/C on OS X Using DMG Packages

A OS X native package installer is provided as a DMG (disk image) file. To install a DMG package, double-click the image file, then follow the prompts.

By default, the DMG package installs Connector/C under /usr/local, into a dedicated directory that does not conflict with the one used by MySQL Server DMG packages.

Installing Connector/C on Linux Using RPM Packages

There are two Linux RPM packages for Connector/C. Install one or both, depending on the capabilities you require:

RPM packages for Connector/C do not include the perror or my_print_defaults utilities.

A Linux RPM package is provided as a file with an .rpm suffix, denoted here as PACKAGE.rpm. To install a given RPM package, use this command:

shell> rpm -i PACKAGE.rpm

RPM provides a feature to verify the integrity and authenticity of packages before installing them. To learn more about this feature, see Verifying Package Integrity Using MD5 Checksums or GnuPG.

Installing Connector/C on Solaris Using PKG Packages

A Solaris PKG package is provided as a file with a .pkg.gz suffix, denoted here as PACKAGE.pkg.gz. To install a PKG package, uncompress it:

shell> gunzip PACKAGE.pkg.gz

Uncompressing PACKAGE.pkg.gz produces PACKAGE.pkg. Then use pkgadd and follow the onscreen prompts:

shell> pkgadd -d PACKAGE.pkg

By default, the PKG package installs Connector/C under the root path /opt/mysql, into a dedicated directory that does not conflict with the one used by MySQL Server PKG packages. You can change only the installation root path using pkgadd, which can be used to install MySQL in a different Solaris zone. If you need to install in a specific directory, use a binary tar file distribution.