明远智睿技术论坛

 找回密码
 立即注册
搜索
查看: 4765|回复: 0
打印 上一主题 下一主题

EK200移植mysql数据库

[复制链接]

89

主题

226

帖子

1099

积分

超级版主

Rank: 8Rank: 8

积分
1099
跳转到指定楼层
楼主
发表于 2019-11-5 09:12:03 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 myzr_soft 于 2019-11-5 09:16 编辑

主机平台: UBUNTU14.04
硬件平台:明远智睿MY-IMX6-EK200-6Q-1G
内核版本 :linux-4.1.15
交叉编译链:arm-poky-linux-gnueabi
文件系统:L4115-fsl-image-qt5-myimx6a9.tar.bz2



下载:
ncurses:

mysql-5.1.72:

解压:
$ 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_meLINENO: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
{ { $as_echo "$as_meLINENO: 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_meLINENO: error: in \`$ac_pwd':" >&5
#$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
#{ { $as_echo "$as_meLINENO: 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/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

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|明远智睿  

GMT+8, 2024-12-27 00:55 , Processed in 0.062549 second(s), 25 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表