MySQL source installation 5.5
I usually install all my database servers from source. This gives me control over server available options and allows me to disable any unwanted options. I am not dependent on OS, too.
Typically I used following combination:
CFLAGS="-O3" CXX=gcc CXXFLAGS="-O3 -felide-constructors \
-fno-exceptions -fno-rtti" ./configure \
--prefix=/usr/local/services/mysql \
--with-mysqld-ldflags=-all-static \
--enable-assembler \
--with-big-tables \
--with-tcp-port=3306 \
--with-unix-socket-path=/tmp/mysql.sock \
--without-debug \
--without-docs \
--without-geometry \
--without-man \
--with-charset=latin2 \
--with-extra-charsets=utf8 \
--with-collation=latin2_general_ci \
--with-plugins=partition,blackhole,innodb \
From MySQL 5.5 configure was replaced with cmake… and installation and gains are not so obvious.
I use CentOS release 5.5 (Final). Before you start to compile, you have to install:
CentOS release 5.5 (Final)
yum install gcc-c++
yum install ncurses-devel
yum install bison.x86_64
yum install cmake (CentOS release 6.3)
# or install from source cmake.org
You have to compile cmake (cmake.org)
Debian 6.0 (Squeeze)
aptitude install g++
aptitude install make
aptitude install ncurses-dev
aptitude install bison++
aptitude install cmake
There is a very helpful site on mysql: Autotools_to_CMake_Transition_Guide
My new recipe is:
cmake . \
-DCMAKE_C_FLAGS="-O3 -m64" \
-DCMAKE_CXX_FLAGS="-m64 -O3 -felide-constructors -fno-exceptions -fno-rtti" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_INSTALL_PREFIX=/usr/local/services/mysql \
-DSYSCONFDIR=/usr/local/services/mysql \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DWITH_PARTITION_STORAGE_ENGINE=1 \
-DWITH_FEDERATED_STORAGE_ENGINE=1 \
-DDEFAULT_CHARSET=latin2 \
-DWITH_EXTRA_CHARSETS=utf8 \
-DDEFAULT_COLLATION=latin2_general_ci \
-DWITH_DEBUG=0 \
-DENABLE_DEBUG_SYNC=0 \
-DWITH_FAST_MUTEXES=0 \
I did not find any replacement for the following:
–with-mysqld-ldflags=-all-static
–enable-assembler
–with-big-tables
–without-docs
–without-geometry
–without-man
I was curious about option -DWITH_FAST_MUTEXES, however, I did not find any sources which would encourage me to turn it on:
- http://code.google.com/p/google-mysql-tools/wiki/Mysql5Patches
- http://bugs.mysql.com/bug.php?id=51285
Postinstallation issues:
Open files limit
Important when partitioning is widely used.
In mysql configuration file (my.cnf) in section [mysqld]
open_files_limit=65536
In system file /etc/security/limits.conf
mysql soft nofile 32768 mysql hard nofile 65536 mysql soft nproc 2047 mysql hard nproc 16384
Swapiness
cat /proc/sys/vm/swappiness
echo 1 > /proc/sys/vm/swappiness
echo “vm.swappiness = 1” >> /etc/sysctl.conf
No comments yet.