bench mysql work_EK200移植mysql数据库

e0d6d2c83d04356e118c2568d29020e1.png

主机平台: UBUNTU14.04

硬件平台:明远智睿MY-IMX6-EK200-6Q-1G

内核版本 :linux-4.1.15

交叉编译链:arm-poky-linux-gnueabi

文件系统:L4115-fsl-image-qt5-myimx6a9.tar.bz2

下载:

ncurses:

ftp://ftp.gnu.org/gnu/ncurses/

mysql-5.1.72:

http://www.mirrorservice.org/sites/ftp.mysql.com/Downloads/MySQL-5.1/mysql-5.1.72.tar.gz

解压:

$ cd

$ mkdir ncurses

$ tar xzvf ncurses-6.1.tar.gz

$ tar xzvf mysql-5.1.72.tar.gz

编译pc版本mysql备用:

$ cd mysql-5.1.72/

$ sudo apt-get install libncurses5-dev

$ ./configure -prefix=/usr/local/mysql

$ make

$ cd ..

$ mv mysql-5.1.72 mysql-5.1.72-pc

配置交叉工具链:

$ su

# source /home/myzr/my-work/03_toolchain/fsl-imx-fb-glibc-x86_64-meta-toolchain-qt5-cortexa9hf-neon-toolchain-4.1.15-2.1.0/environment-setup-cortexa9hf-neon-poky-linux-gnueabi

交叉编译ncurses:

# cd ncurses-6.1/

./configure --prefix=/home/myzr/ncurses/ --host=arm-poky-linux-gnueabi --without-cxx --without-cxx-binding --without-ada --without-manpages --without-progs --without-tests --with-shared --enable-static

# make -j4

# make install

交叉编译mysql:

# cd ..

# tar xzvf mysql-5.1.72.tar.gz

# cd mysql-5.1.72

# gedit configure

将四处:

if test "$cross_compiling" = yes; then

{ { $as_echo "$as_me

65e7976fbf08499e6f76fceeb114e7ad.gif

LINENO: error: in `$ac_pwd':" >&5

$as_echo "$as_me: error: in `$ac_pwd':" >&2;}

{ { $as_echo "$as_me

65e7976fbf08499e6f76fceeb114e7ad.gif

LINENO: error: cannot run test program while cross compiling

See `config.log' for more details." >&5

$as_echo "$as_me: error: cannot run test program while cross compiling

See `config.log' for more details." >&2;}

{ (exit 1); exit 1; }; }; }

else

修改为:

if test "$cross_compiling" = yes; then

echo"skipcorss_compiping test";

# { { $as_echo "$as_me

65e7976fbf08499e6f76fceeb114e7ad.gif

LINENO: error: in `$ac_pwd':" >&5

#$as_echo "$as_me: error: in `$ac_pwd':" >&2;}

#{ { $as_echo "$as_me

65e7976fbf08499e6f76fceeb114e7ad.gif

LINENO: error: cannot run test program while cross compiling

#See `config.log' for more details." >&5

#$as_echo "$as_me: error: cannot run test program while cross compiling

#See `config.log' for more details." >&2;}

# { (exit 1); exit 1; }; }; }

else

# mkdir /usr/local/mysql

# ./configure --host=arm-poky-linux-gnueabi --enable-static --with-named-curses-libs=/home/myzr/ncurses/lib/libncurses.a --prefix=/usr/local/mysql --without-debug --without-docs --without-man --without-bench --with-charset=gb2312 --with-extra-charsets=ascii,latin1,utf8

# vi storage/innobase/include/univ.i

将227行的:#error "Error: InnoDB's ulint must be of the same size as void*"

修改为://#error "Error: InnoDB's ulint must be of the same size as void*"

# vi storage/innodb_plugin/include/univ.i

将358行的:#error "Error: InnoDB's ulint must be of the same size as void*"

修改为://#error "Error: InnoDB's ulint must be of the same size as void*"

# make

出现错误:

./gen_lex_hash > lex_hash.h-t

/bin/sh: ./gen_lex_hash: cannot execute binary file

# cp ../mysql-5.1.72-pc/sql/gen_lex_hash sql/

# touch -m sql/gen_lex_hash

# make

出现错误:

sql_parse.cc:5741:21: error: operator '<' has no left operand

# vi sql/http://sql_parse.cc

加入:#define STACK_DIRECTION 1

# make

拷贝pc的/usr/local/mysql到开发板的相同目录

在开发板上执行:

设置环境变量或将/usr/local/mysql/bin 下面的可执行文件复制到/usr/sbin 目录下

# export PATH="$PATH:/usr/local/mysql/bin"

添加/etc/my.conf 配置文件

# vi /etc/my.conf

内容如下:

datadir=/var/lib/mysql

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=1

[mysqld_safe]

log-error=/var/log/mysqld.log

pid-file=/var/run/mysqld/mysqld.pid

因为在/var/run目录下没有mysqld/mysqld.pid,手工建立:

# mkdir /var/run/mysqld

# touch /var/run/mysqld/mysqld.pid

安装数据库:

#mysql_install_db -u root

启动mysql服务:

# mysqld_safe --user=root --skip-grant-tables --skip-networking &

# mysql

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值