-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall_mysqlcppconnector.sh
More file actions
executable file
·49 lines (38 loc) · 1.81 KB
/
Copy pathinstall_mysqlcppconnector.sh
File metadata and controls
executable file
·49 lines (38 loc) · 1.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# First install meta-package mysql-server
sudo apt-get install mysql-server
# This will install following packages
#mysql-client-5.5 mysql-client-core-5.5 mysql-server-5.5 mysql-server-core-5.5
# If you want to install default package from repos
#sudo apt-get install libmysqlcppconn-dev
# else do the following
# Download and extract source code for mysql connector 1.1.6
mkdir -p ~/Downloads
cd ~/Downloads
wget -nc http://dev.mysql.com/get/Downloads/Connector-C++/mysql-connector-c++-1.1.6.tar.gz
tar -xvzf mysql-connector-c++-1.1.6.tar.gz
cd mysql-connector-c++-1.1.6
# The following is based on the INSTALL file included in the mysql-connector
# Generate Makefile
cmake . # cmake -L to debug
# Build the libraries
make clean
make
#If all goes well, following libraries (or links) are created
#/mysql-connector-c++-1.1.6/driver/libmysqlcppconn.so
#/mysql-connector-c++-1.1.6/driver/libmysqlcppconn.so.7
#/mysql-connector-c++-1.1.6/driver/libmysqlcppconn.so.7.1.1.6
#/mysql-connector-c++-1.1.6/driver/libmysqlcppconn-static.a
# Install
#make install # This fails
# Unless you have changed the location in the configuration step, make install
#copies the header files to the directory /usr/local/include.
#The header files copied are mysql_connection.h and mysql_driver.h.
sudo mkdir -p /usr/local/include/cppconn
sudo cp -r cppconn/* /usr/local/include/cppconn/
sudo cp driver/mysql_connection.h driver/mysql_driver.h /usr/local/include/
# Again, unless you have specified otherwise, make install copies the library files
#to /usr/local/lib. The files copied are the dynamic library libmysqlcppconn.so,
#and the static library libmysqlcppconn-static.a. The extension of the dynamic
#library might be different on your system (for example, .dylib on OS X).
sudo mkdir -p /usr/local/lib
sudo cp driver/libmysqlcppconn* /usr/local/lib/