Compiling percona xtradb on ubuntu 10.04
I recently had to compile from source the Percona blend of mysql 5.4 and ran into a few hiccups that I don’t normally see when doing a vanilla mysql install. In particular I ran into the same issue described here and here.
"/bin/bash ../ylwrap sql_yacc.yy y.tab.c sql_yacc.cc y.tab.h sql_yacc.h y.output sql_yacc.output -- -d --verbose
../ylwrap: line 111: -d: command not found
make[1]: *** [sql_yacc.cc] Error 1"
Apparently having nothing to do with percona but with mysql and yacc not finding bison and possibly flex. So I installed both of those via APT and ran a make clean, make, make install and still same error. Then I realized that the configure script is probably what sets the make switches for using bison so I re-ran
CC="gcc -static-libgcc" CFLAGS="-O3 -pipe -m64 -fPIC -fomit-frame-pointer" CXX="gcc -static-libgcc" CXXFLAGS="-O3 -pipe -m64 -fPIC -fomit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti" sudo ./configure -prefix=/opt/xtradb -enable-local-infile -enable-thread-safe-client -enable-assembler -with-client-ldflags=-all-static -with-mysqld-ldflags=-all-static -with-unix-socket-path=/opt/xtradb/tmp/mysql.sock -with-plugins=partition,archive,blackhole,csv,federated,heap,ibmdb2i,innobase,innodb_plugin,myisam,myisammrg -with-big-tables -without-debug -with-tcp-port=3306 -with-readline -enable-profiling -disable-shared -enable-static -with-extra-charsets=complex -with-pic -with-fast-mutexes -with-zlib-dir=bundled -with-ssl
and then another make make install
And it worked successfully.
Hope this helps!
PS. If you want the full list of libraries that I needed to install in order to compile correctly:
apt-get install gcc build-essential automake ncurses libncurses5-dev libtool termcap bison flex
Update: since I was using the stock ubuntu 10.04 server install apparmor was installed and keeping mysql from correctly installing it’s databases in a non-standard directory. I kept getting this error:
/opt/xtradb/bin/mysql_install_db --user=mysql --ldata=/opt/xtradb/data
Installing MySQL system tables...
100802 10:26:54 [Warning] Can't create test file /opt/xtradb/data/ubuntu.lower-test
So just had to run a
apt-get purge apparmor
restart and then run
/opt/xtradb/bin/mysql_install_db --user=mysql --ldata=/opt/xtradb/data
and finally I could start mysql
REXML could not parse this XML/HTML: <code> /opt/xtradb/bin/mysqld_safe --defaults-file=/opt/xtradb/conf/my.cnf --user=mysql --basedir=/opt/xtradb --datadir=/opt/xtradb/data --log-error=/var/log/xtradb/mysql.err & </code>