等待已久的mysql5.5.8终于发布了
MySQL的5.5比起之前的版本,除了InnoDB中的改善以外,最重要的是半复制成为内建功能,这个功能使得需要后读写一致性的查询可以不用强制绑在主机上做。
性能改进也不错的,一个朋友在其客户的机器上的一张100亿条记录的客户表上做过实验,速度比5.1快了60%。
测试数据:
InnoDB,FULL TABLE SCAN,没有使用任何索引。。。
我个人比较看重的是半复制功能。可以解决我们论坛数据库的同步延迟问题。。。
源码包安装比较特别,需要使用cmake,跨平台比较不错.
安装步骤
查看更多参数:cmake . -LAH # H为打印说明开关符、A为打印所有开关符
http://forge.mysql.com/wiki/CMake#Listing_configuration_parameters
yum install cmake
tar xvzf mysql-5.5.8.tar.gz
cd mysql-5.5.8
CFLAGS="-O3 -g"
CXX=gcc
CXXFLAGS="-O3 -g -felide-constructors -fno-exceptions -fno-rtti"
export CFLAGS CXX CXXFLAGS
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql #mysql安装目录
-DMYSQL_DATADIR=/home/system_username/Programming/mysql/mysqldata
-DSYSCONFDIR=/etc
-DWITH_INNOBASE_STORAGE_ENGINE=1
-DWITH_ARCHIVE_STORAGE_ENGINE=1
-DWITH_BLACKHOLE_STORAGE_ENGINE=1
-DWITH_FEDERATED_STORAGE_ENGINE=1
-DWITH_PARTITION_STORAGE_ENGINE=1
-DMYSQL_UNIX_ADDR=/tmp/mysqld.sock
-DMYSQL_TCP_PORT=3306
-DENABLED_LOCAL_INFILE=1
-DEXTRA_CHARSETS=all
-DDEFAULT_CHARSET=utf8
-DDEFAULT_COLLATION=utf8-general_ci
-DMYSQL_USER=mysql
make -j 2
make install
方法2:
BUILD/autorun.sh;
./configure <lots of parameters>;
make
附录 configure参数
Table 2.14. MySQL Source-Configuration Option Reference (CMake)
Formats Description Default Introduced Removed
BUILD_CONFIG Use same build options as official releases
CMAKE_BUILD_TYPE Type of build to produce RelWithDebInfo
CMAKE_INSTALL_PREFIX Installation base directory /usr/local/mysql
CPACK_MONOLITHIC_INSTALL Whether package build produces single
file OFF
DEFAULT_CHARSET The default server character set latin1
DEFAULT_COLLATION The default server collation latin1_swedish_ci
ENABLE_DEBUG_SYNC Whether to enable Debug Sync support ON
ENABLE_DOWNLOADS Whether to download optional files OFF
ENABLE_DTRACE Whether to include DTrace support
ENABLED_LOCAL_INFILE Whether to enable LOCAL for LOAD DATA INFILE
OFF
ENABLED_PROFILING Whether to enable query profiling code ON
INSTALL_BINDIR User executables directory PREFIX/bin
INSTALL_DOCDIR Documentation directory PREFIX/docs
INSTALL_DOCREADMEDIR README file directory PREFIX
INSTALL_INCLUDEDIR Header file directory PREFIX/include
INSTALL_INFODIR Info file directory PREFIX/docs
INSTALL_LAYOUT Select predefined installation layout STANDALONE
INSTALL_LIBDIR Library file directory PREFIX/lib
INSTALL_MANDIR Manual page directory PREFIX/man
INSTALL_MYSQLSHAREDIR Shared data directory PREFIX/share
INSTALL_MYSQLTESTDIR mysql-test directory PREFIX/mysql-test
INSTALL_PLUGINDIR Plugin directory PREFIX/lib/plugin
INSTALL_SBINDIR Server executable directory PREFIX/bin
INSTALL_SCRIPTDIR Scripts directory PREFIX/scripts
INSTALL_SHAREDIR aclocal/mysql.m4 installation directory
PREFIX/share
INSTALL_SQLBENCHDIR sql-bench directory PREFIX
INSTALL_SUPPORTFILESDIR Extra support files directory
PREFIX/support-files
MYSQL_DATADIR Data directory
MYSQL_MAINTAINER_MODE Whether to enable MySQL maintainer-specific
development environment OFF
MYSQL_TCP_PORT TCP/IP port number 3306
MYSQL_UNIX_ADDR Unix socket file /tmp/mysql.sock
SYSCONFDIR Option file directory
WITH_COMMENT Comment about compilation environment
WITH_DEBUG Whether to include debugging support OFF
WITH_EMBEDDED_SERVER Whether to build embedded server OFF
WITH_xxx_STORAGE_ENGINE Compile storage engine xxx statically into
server
WITH_EXTRA_CHARSETS Which extra character sets to include all
WITH_LIBWRAP Whether to include libwrap (TCP wrappers) support OFF
WITH_READLINE Use bundled readline OFF
WITH_SSL Type of SSL support no
WITH_ZLIB Type of zlib support system
WITHOUT_xxx_STORAGE_ENGINE Exclude storage engine xxx from build