yum install gcc gcc-c++ ncurses-devel
CFLAGS="-O3 -mpentiumpro" CXX=gcc CXXFLAGS="-O3 -mpentiumpro \-felide-constructors -fno-exceptions -fno-rtti" ./configure \
--prefix=/opt/mysql \
--enable-assembler \
--with-charset=utf8 \
--with-collation=utf8_general_ci \
--with-extra-charsets=gbk,gb2312,binary \
--enable-thread-safe-client \
--with-pthread \
--with-mysqld-ldflags=-all-static \
--with-client-ldflags=-all-static 当执行./configure后出现如下报错: /bin/rm: cannot remove `libtoolT': No such file or directory 可以忽略,或先执行: autoreconf --force --installmakemake installluseradd -r -s /sbin/nologin -d /opt/mysql/var mysql/opt/mysql/bin/mysql_install_db --user=mysqlcp /opt/mysql/share/mysql/my-medium.cnf /etc/my.cnfcp /opt/mysql/share/mysql/mysql.server /etc/init.d/mysqldchkconfig --add mysqldchkconfig --level 35 mysqld onchkconfig --list mysqldcd /opt/mysql/libexeccp mysqld mysqld.old 备份文件
strip mysqld 删除调试符号,生成的二进制可以快4%
service mysqld startcp /opt/mysql/bin/mysql /usr/bin 复制一份去命令路径,以下脚本要用到mysql
/opt/mysql/bin/mysql_secure_installation
评论