下载相关软件源码包
wget http://downloads.mariadb.org/f/mariadb-5.5.27/kvm-tarbake-jaunty-x86/mariadb-5.5.27.tar.gz/from/http:/ftp.yz.yamagata-u.ac.jp/pub/dbms/mariadb wget http://www.cmake.org/files/v2.8/cmake-2.8.5.tar.gz
tar zxf cmake-2.8.5.tar.gz cd cmake-2.8.5 ./bootstrap make make install cd ..
#配置编译器,提高性能
CFLAGS="-O3" CXX=gcc CXXFLAGS="-O3 -felide-constructors -fno-exceptions -fno-rtti"
开始安装mariadb
yum install ncurses-devel -y yum install libaio-devel -y useradd mysql tar -zxvf mariadb-5.5.27.tar.gz cd mariadb-5.5.27 cmake . -LH|more //CMake下查看MySQL的编译配置 cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mariamysql -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_FEDERATED_STORAGE_ENGINE=1 -DENABLED_LOCAL_INFILE=1 -DEXTRA_CHARSETS=all -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_DEBUG=0 -DBUILD_CONFIG=mysql_release -DFEATURE_SET=community -DWITH_EMBEDDED_SERVER=OFF make -j 8 //-j指定用于编译的CPU核数,可以加快编译速度 make install cp support-files/my-innodb-heavy-4G.cnf /etc/my.cnf /usr/local/mariamysql/scripts/mysql_install_db --basedir=/usr/local/mariamysql/ --datadir=/usr/local/mariamysql/data/ --user=mysql /usr/local/mariamysql/bin/mysqld_safe --user=mysql &