Warning: This version of MySQL is deprecated and has been replaced by MySQL 5.5.20. This page and attached files are being kept for reference, but should not be deployed on any systems.
MySQL requires zlib and ncurses. This is a different compilation procedure as the previous one, since we try to statically link the dependencies to make the deployment easier. It also saves 17 MB from the uncompressed app and 6.5 MB from the DroboApp package. The same problems seen before (e.g., not cross-compile friendly, complex procedure overall) still remain, as this is a small bugfix release. So we still have to compile MySQL twice to get the required binaries: 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.12.tar.gz/from/ftp://mirror.switch.ch/mirror/mysql/ tar zxf mysql-5.5.12.tar.gz cd mysql-5.5.12/ 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 --static make clean && make ZLIB=`pwd` cd .. wget http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.9.tar.gz tar zxf ncurses-5.9.tar.gz cd ncurses-5.9/ ./configure --host=arm-none-linux-gnueabi --prefix=$DEST --without-shared make clean && make NCURSES=`pwd` cd .. cd mysql-5.5.12/ 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=$NCURSES/lib/libncurses.a -DCURSES_INCLUDE_PATH=$NCURSES/include -DWITH_ZLIB=system -DZLIB_LIBRARY=$ZLIB/libz.a -DZLIB_INCLUDE_DIR=$ZLIB cp ~/bin/comp_err extra/ cp ~/bin/comp_sql scripts/ cp ~/bin/gen_lex_hash sql/ make && make install
cd $DEST mkdir -p etc var/run var/log cp support-files/my-small.cnf etc/my.cnf wget http://www.droboports.com/app-repository/mysql-5-5-12/service.sh chmod a+x service.sh ~/bin/package.sh
DroboAdmin link: Install mysql-5.5.12 (this link only works if you have not changed the DroboFS name). Otherwise, download below and place it in you DroboApps share.
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.
Warning: Upgrading from the previous version will most likely erase all configuration and data.
It is possible to upgrade from the previous version without losing any configuration and without having to restart the DroboFS. To do so, follow these steps on the DroboFS:
cd /mnt/DroboFS/Shares/DroboApps/ ./mysql/service.sh stop mv mysql mysql.old wget http://commondatastorage.googleapis.com/drobofs/mysql.tgz DroboApps.sh install cp -R mysql.old/etc/* mysql/etc/ cp -R mysql.old/data/* mysql/data/ ./mysql/service.sh start
Once you are sure that the new server works, you should remove the 'mysql.old' folder, since it may cause conflicts on startup with the new server.
Please visit the DroboSpace forums to leave your comments, suggestions and feedback.