交叉编译MySql5.7.28

环境ubuntu18.04,使用交叉编译工具链aarch64-linux-gnu。

主要参考以下两篇博客:

mysql交叉编译到ARM平台(hisi)

mysql交叉编译,移植至ARM

精简可以参考这篇博客:

MySQl精简

以下主要讲不同以及注意事项:

1、需要手动编译OPENSSL,版本openssl-1.1.1g,编译后路径为openssl-arm-install

2、cmake 中指定参数 -DOPENSSL_ROOT_DIR=/home/zfadmin/mysqlCompile/openssl-arm-install

3、不需要编译boost,只需要指定mysql中自带的boost路径即可;

4、make install 的时候指定目录: make install DESTDIR=/opt/mysql_arm_install/

5、移植过后需要手动添加my.cnf


1、compile-arm设置如下:

#! /bin/sh

path='dirname $0'
 
cmake .. -DWITH_DEBUG=0 -DSTACK_DIRECTION=1 -DENABLE_DOWNLOADS=1 -DOPENSSL_ROOT_DIR=/home/zfadmin/mysqlCompile/openssl-arm-install -DDOWNLOAD_BOOST=1 -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATIOIN=utf8_general_ci -DEXTRA_CHARSETS=all -DENABLED_LOCAL_INFILE=1 -DWITH_BOOST=../boost -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc -DCURSES_INCLUDE_PATH=/home/zfadmin/mysqlCompile/ncurses-6.1-arm/include -DCURSES_LIBRARY=/home/zfadmin/mysqlCompile/ncurses-6.1-arm/lib/libncurses.a

2、手动添加my.cnf文件,其中包含了字符支持

[mysqld]
datadir=/usr/local/mysql/data
socket=/tmp/mysql.sock

user=root
#Default to using old password format for compatibility with mysql 3.x

#clients (those using the mysqlclient10 compatibility package).

#old_passwords=0

group_concat_max_len=4294967295
skip-name-resolve
lower_case_table_names=1

interactive_timeout=28800000
wait_timeout=28800000

#innodb_flush_log_at_trx_commit=2
sync_binlog=1

bind-address = 0.0.0.0

port=13306

character-set-server=utf8
collation-server=utf8_general_ci

3、设置mysqld开机自启

5、提示找不到/home/zfadmin/mysql-5.7.28/BUILD_ARM/scripts/comp_sql: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory

使用find能找到/usr/aarch64-linux-gnu/lib/libc.so.6,添加libc路径到命令行中

export LD_LIBRARY_PATH=/usr/aarch64-linux-gnu/lib:$LD_LIBRARY_PATH
 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

LanSe___

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值