Warning: This version of MySQL is deprecated and has been replaced by MySQL 5.5.12. This page and attached files are being kept for reference, but should not be deployed on any systems.
MySQL requires zlib and ncurses. We cross-compile both of them and place them together in the same folder. MySQL is not very cross-compile friendly, since it uses executables generated during the compilation to complete the compilation. To work around that, we basically have to compile MySQL twice: once natively, and a second time for the Drobo.
Overall, this is a very complicated port. It requires extra packages, it deals with a different build system (cmake), and there are a number of things that can go wrong. Please be patient while trying this.
Make sure you have a cross-compiling virtual machine properly setup. A few extra packages are required to compile MySQL:
apt-get install cmake ccmake g++ libncurses5-dev
Make sure that you have this cmake_toolchain_file in your home directory.
SET(CMAKE_SYSTEM_NAME Linux) SET(CMAKE_SYSTEM_PROCESSOR armv5te) SET(CMAKE_C_COMPILER /usr/local/arm-2007q1/bin/arm-none-linux-gnueabi-gcc) SET(CMAKE_C_FLAGS -march=armv5te) SET(CMAKE_CXX_COMPILER /usr/local/arm-2007q1/bin/arm-none-linux-gnueabi-g++) SET(CMAKE_CXX_FLAGS -march=armv5te) SET(CMAKE_AR /usr/local/arm-2007q1/bin/arm-none-linux-gnueabi-ar) SET(CMAKE_RANLIB /usr/local/arm-2007q1/bin/arm-none-linux-gnueabi-ranlib) SET(CMAKE_STRIP /usr/local/arm-2007q1/bin/arm-none-linux-gnueabi-strip) SET(STACK_DIRECTION 1) SET(CMAKE_FIND_ROOT_PATH /usr/local/arm-2007q1/arm-none-linux-gnueabi/libc) SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
We have first (temporarily) to undo the cross compilation environment to compile MySQL natively. Then we reestablish the cross compiling variables and proceed.
export DEST=/mnt/DroboFS/Shares/DroboApps/mysql cd ~/code/ . ~/uncrosscompile.sh wget http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.9.tar.gz/from/ftp://mirror.switch.ch/mirror/mysql/ tar zxf mysql-5.5.9.tar.gz cd mysql-5.5.9/ cmake . make cp extra/comp_err ~/bin/ cp scripts/comp_sql ~/bin/ cp sql/gen_lex_hash ~/bin/ rm CMakeCache.txt make clean cd .. . ~/crosscompile.sh wget http://zlib.net/zlib-1.2.5.tar.gz tar zxf zlib-1.2.5.tar.gz cd zlib-1.2.5 ./configure --prefix=$DEST make clean && make && make install cd .. wget http://ftp.gnu.org/gnu/ncurses/ncurses-5.8.tar.gz tar zxf ncurses-5.8.tar.gz cd ncurses-5.8/ ./configure --host=arm-none-linux-gnueabi --prefix=$DEST make clean && make && make install cd .. cd mysql-5.5.9/ cmake -DCMAKE_TOOLCHAIN_FILE=~/cmake_toolchain_file -DCMAKE_AR=/usr/local/arm-2007q1/bin/arm-none-linux-gnueabi-ar -DCMAKE_STRIP=/usr/local/arm-2007q1/bin/arm-none-linux-gnueabi-strip -DWITH_EMBEDDED_SERVER=TRUE -DCMAKE_INSTALL_PREFIX=$DEST -DMYSQL_DATADIR=$DEST/data -DCURSES_LIBRARY=$DEST/lib/libncurses.a -DCURSES_INCLUDE_PATH=$DEST/include -DWITH_ZLIB=system -DZLIB_LIBRARY=$DEST/lib/libz.so -DZLIB_INCLUDE_DIR=$DEST/include cp ~/bin/comp_err extra/ cp ~/bin/comp_sql scripts/ cp ~/bin/gen_lex_hash sql/ make && make install
cd $DEST cp support-files/my-small.cnf my.cnf wget http://www.droboports.com/app-repository/mysql-5-5-9/service.sh chmod a+x service.sh ~/bin/package.sh
MySQl is a very big application. It will consume a lot of memory, even with the my-small.cnf template. Keep in mind that the DroboFS does not have a lot of RAM (around 180 MB available total), so it will probably not be a very good/fast MySQL server. In other words, don't try to use it as a production server. It will most likely crash and burn.
Please visit the DroboSpace forums to leave your comments, suggestions and feedback.