编译libmysqlclient.a静态库

mysql版本:mysql-5.7.17

依次执行:

cd /home

wget https://sourceforge.net/projects/boost/files/boost/1.59.0/boost_1_59_0.tar.gz
tar -zxvf boost_1_59_0.tar.gz

wget https://cdn.mysql.com/Downloads/MySQL-5.7/mysql-5.7.17.tar.gz
tar -zxvf mysql-5.7.17.tar.gz


生成makefile:
cd mysql-5.7.17
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/usr/local/mysql/data -DMYSQL_UNIX_ADDR=/tmp/mysql.sock -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_BOOST=/home/boost_1_59_0

编译
make -j4

静态库位置:
mysql-5.7.17/libmysql/libmysqlclient.a

posted @ 2019-03-21 12:34  lcinx  阅读(2590)  评论(0编辑  收藏  举报