mysql:5.5.58,arm 32位开发板:centos 7,4.4.52-armada-17.06.2
一、下载mysql源码
http://www.mirrorservice.org/sites/ftp.mysql.com/Downloads/
选择5.5.58版本下载
二、解压mysl,并安装相关依赖包
tar zxvf mysql-5.5.58.tar.gz
yum install gcc gcc-c++ openssl openssl-devel ncurses ncurses-devel cmake
三、建立/usr/local/mysql文件
mkdir /usr/local/mysql
我们编译以root用户编译
四、编译
1、执行cmake
cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/usr/local/mysql/data -DSYSCONFDIR=/etc -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DWITH_FEDERATED_STORAGE_ENGINE=1 -DWITH_PARTITION_STORAGE_ENGINE=1 -DMYSQL_TCP_PORT=3306 -DENABLED_LOCAL_INFILE=1 -DWITH_SSL=yes -DEXTRA_CHARSETS=all -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_READLINE=on
2、编译
因为5.5.58版本在arm架构机器上不兼容所以修改源码
--- mysql-5.5.8.orig/sql-common/client_plugin.c +++ mysql-5.5.8/sql-common/client_plugin.c @@ -233,6 +233,7 @@ int mysql_client_plugin_init() { MYSQL mysql; struct st_mysql_client_plugin **builtin; + va_list dummy; if (initialized) return 0; @@ -249,7 +250,7 @@ int mysql_client_plugin_init() pthread_mutex_lock(&LOCK_load_client_plugin); for (builtin= mysql_client_builtins; *builtin; builtin++) - add_plugin(&mysql, *builtin, 0, 0, 0); + add_plugin(&mysql, *builtin, 0, 0, dummy); pthread_mutex_unlock(&LOCK_load_client_plugin); @@ -293,6 +294,7 @@ struct st_mysql_client_plugin * mysql_client_register_plugin(MYSQL *mysql, struct st_mysql_client_plugin *plugin) { + va_list dummy; if (is_not_initialized(mysql, plugin->name)) return NULL; @@ -307,7 +309,7 @@ mysql_client_register_plugin(MYSQL *mysq plugin= NULL; } else - plugin= add_plugin(mysql, plugin, 0, 0, 0); + plugin= add_plugin(mysql, plugin, 0, 0, dummy); pthread_mutex_unlock(&LOCK_load_client_plugin); return plugin;
参考:http://sophie.zarb.org/distrib/Mageia/1/i586/media/core-updates-src/by-pkgid/3d9c17c564d30ead0a0dab9855d22f9d/files/27
make && make install
note1:运行cmake时出错, Could NOT find Curses (missing: CURSES_LIBRARY CURSES_INCLUDE_PATH)
安装相应的包后删除CMakeCache.txt文件:rm CMakeCache.txt
note2: cmake 时配置错误Library mysqlclient depends on OSLIBS -lpthread;z;m;/usr/lib/libssl.so;/usr/lib/libcrypto.so;dl
解决办法: yum install gcc gcc-c++ openssl openssl-devel ncurses ncurses-devel cmake
note3: