The MySQL website offers a variety of mysqlclient, which provide developers with the development of MySQL interfaces, where the Linux version provides different packages based on branch and branch versions.
Since I am the latest version of Ubuntu 16.04, I have not found the corresponding development package, and consider the following version upgrade and porting issues, or the way to use the source package is the most reliable.
But the source package does not provide installation instructions, find a half-day on the official website to find the installation tutorial.
4.2.1 Installing connector/c from Source on Unix and Unix-like Systems
If the native compiler toolset for the target platform are available (for example, Sunstudio for Solaris) For compilation. Alternatively, the GNU toolset can be used on all platforms.
You also need CMake 2.6 or newer, which are available from cmake.org.
To build and install the source distribution, use the following procedure:
Change location to the top-level directory of the source distribution.
Generate the Makefile
:
cmake -G "Unix Makefiles"
Or, for a Debug build:
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug
By default, the installation location for CONNECTOR/C is /usr/local/mysql
. To the CMAKE_INSTALL_PREFIX
specify a different directory when generating the Makefile
. For example:
cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/opt/local/mysql
For the other CMake options, the might find useful, see the other connector/c Build options.
Build the project:
make
As root
, install the connector/c headers, libraries, and utilities:
Root-shell>make install
执行完一系列cmake后将产生makefile文件
注意将第二步中的install目录设置到自己的文件路径下
Mysql-mysql Interface Design MYSQL-CONNECTOR-C source installation