编译安装MySQL

2010-06-10 18:27  |  分类:MySQL

使用rpm包,或者apt-get、yum等方式安装MySQL已经很方便了,不过我还是更喜欢编译安装。编译安装的好处:平台无关、安装的MySQL目录独立(方便清楚),据说有更好的性能和平台耦合。缺点,编译安装较慢(不过现在8核CPU编译起来也很快了)。

1. MySQL编译参数

常用的参数有:

CFLAGS="-O3" CXX=gcc CXXFLAGS="-O3 -felide-constructors \ -fno-exceptions -fno-rtti" ./configure \ --prefix=/data/mysql --with-extra-charsets=latin1,gbk,utf8 \ --with-plugins=partition,heap,innobase,myisam,myisammrg,csv \ --enable-assembler make make install

“If you are using a version of gcc recent enough to understand the -fno-exceptions option, it is very important that you use this option. Otherwise, you may compile a binary that crashes randomly. Also use -felide-constructors and -fno-rtti along with -fno-exceptions.”[......]

Read more