一,编译ncurses

  编译mysql需要依赖ncurses,先编译ncurses

1.下载ncurses

  下载路径是ftp://ftp.gnu.org/gnu/ncurses,选择下载的是ncurses-5.9.tar.gz。

2.解压,配置,编译,安装

  配置参数如下:

./configure --prefix=/home/shawn/AM335x/ncurses \
CC=arm-arago-linux-gnueabi-gcc \
--host=arm-arago-linux-gnueabi \
--enable-static \
--enable-shared

  编译安装,编译完成后,供编译mysql使用。

make
make install

二,编译Mysql

1.下载路径 http://www.mirrorservice.org/sites/ftp.mysql.com/Downloads/MySQL-5.1/

2.选择下载 mysql-5.1.72.tar.gz

3.解压,复制一个mysql-5.1.72-PC,编译一个pc版本的以备后用

4.configure and make

./configure --prefix=/home/shawn/PC/mysql

  执行configure会报错

checking for wctype_t in wctype.h... yes
checking for wint_t in wctype.h... yes
checking for tgetent in -lncursesw... no
checking for tgetent in -lncurses... no
checking for tgetent in -lcurses... no
checking for tgetent in -ltermcap... no
checking for tgetent in -ltinfo... no
checking for termcap functions library... configure: error: No curses/termcap library found
shawn@ubuntu:~/work/mysql-5.1.72-PC$

  原因是缺少ncurses库,安装一下,再次configure

sudo apt-get install libncurses5-dev

  继续报错

config.status: executing libtool commands
/bin/rm: cannot remove 'libtoolT': No such file or directory
config.status: executing default commands Thank you for choosing MySQL! Remember to check the platform specific part of the reference manual
for hints about installing MySQL on your platform.
Also have a look at the files in the Docs directory. shawn@ubuntu:~/work/mysql-5.1.72-PC$

  安装libtool autoconf automake

sudo apt-get install libtool autoconf automake

  执行如下三条命令

autoreconf --force --install
libtoolize --automake --force
automake --force --add-missing

  好吧,我承认,还是没有解决这个问题。。。。。。。先忽略掉。。。。。make,报错

mysql.cc:2687:37: error: invalid conversion from ‘char’ to ‘char*’ [-fpermissive]

  打开client/mysql.cc,2687行 修改代码

field_names[i][num_fields*2]= '\0';
改成
field_names[i][num_fields*2]= "";

  

4.修改congifure,共有四处要修改,使用notepad++修改,在notepad++中,使用Ctrl+G跳到指定行数

//26302行开始的地方
if test "$cross_compiling" = yes; then
echo "skip......"
# { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
#$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
#{ { $as_echo "$as_me:$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
cat >conftest.$ac_ext <<_ACEOF
//48121开始的地方
if test "$cross_compiling" = yes; then
echo "skip......"
# { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
#$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
#{ { $as_echo "$as_me:$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
cat >conftest.$ac_ext <<_ACEOF
//48228开始的地方
if test "$cross_compiling" = yes; then
echo "skip......"
# { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
#$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
#{ { $as_echo "$as_me:$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
cat >conftest.$ac_ext <<_ACEOF
//48442开始的地方
if test "$cross_compiling" = yes; then
echo "skip......"
# { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
#$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
#{ { $as_echo "$as_me:$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
cat >conftest.$ac_ext <<_ACEOF

5.配置configure,with-named-curses-libs就是上面ncurses编译出来的路径

./configure --host=arm-arago-linux-gnueabi \
--prefix=/home/shawn/AM335x/mysql \
CC=arm-arago-linux-gnueabi-gcc \
--enable-static \
--with-named-curses-libs=/home/shawn/AM335x/ncurses/lib \
--prefix=/usr/local/mysql \
--without-debug \
--without-docs \
--without-man \
--without-bench \
--with-charset=gb2312 \
--with-extra-charsets=ascii,latin1,utf8

  执行configure的时候,报了如下错误

checking for atomic_cas_32... no
checking for atomic_cas_64... no
checking for atomic_cas_ulong... no
checking for atomic_swap_uchar... no
checking whether pthread_t can be used by Solaris libc atomic functions... configure: error: in `/home/shawn/work/mysql-5.1.72':
configure: error: cannot run test program while cross compiling
See `config.log' for more details.
shawn@ubuntu:~/work/mysql-5.1.72$

  打开同路径下的config.log查看错误,直接搜索error,第一个错误是,a.out不能运行的,忽略掉。

conftest.c:10:28: fatal error: ac_nonexistent.h: No such file or directory

  

最新文章

  1. S5PV210_流水灯
  2. objective-c 语法快速过(6)内存管理原理
  3. jquery层级原则器(匹配前一个元素后的所有平辈元素)
  4. html中label宽度设置、非替换元素和替换元素
  5. fedora下缺少autopoint包的解决办法
  6. iOS与Android通用AES加密
  7. 终止imp/exp和expdp/impdp进程运行的方法
  8. 自定义TypeConverter把基础类型转换为复杂类型
  9. linux关闭防火墙方法
  10. 10个必备的移动UI设计资源站
  11. VBS基础篇 - VBScript过程
  12. 最简化模型2——css3分阶段动画效果(经过实测)之转动的div
  13. CSS随笔1(CSS常用样式)
  14. wstring操作与普通段字符操作对照表
  15. gulp+ThinkPHP配置
  16. NET操作RabbitMQ组件EasyNetQ
  17. JavaScript深入之从原型到原型链
  18. 7.mysql-安装和卸载.md
  19. CVPR2019 | Mask Scoring R-CNN 论文解读
  20. java 重载 : 1.参数个数不同,2.参数类型不同

热门文章

  1. 如何将本地的文件上传到你的github仓库中(首次流程)
  2. 关于springboot项目中自动注入,但是用的时候值为空的BUG
  3. 剑指Offer (汇总)
  4. C Primer Plus Study Note
  5. Mac OS本地,XAMPP,出现 “phpMyAdmin 尝试连接到 MySQL 服务器,但服务器拒绝连接”错误
  6. DatePickerAndroid用法
  7. Flask 上下文管理
  8. java后台常见问题
  9. asp。net内置委托
  10. linux nginx 如何配置多个端口