Home > Database > Mysql Tutorial > body text

MySQL数据库优化推荐的编译安装参数小结_MySQL

WBOY
Release: 2016-06-01 13:00:32
Original
822 people have browsed it

MySQL编译参数多而复杂,让新手感到很头大,如果是正式生成环境安装MySQL,没有充足的时间去研究每一个参数代表的意义,个人建议使用余洪春前辈整理的编译参数,便捷高效!

MySQL的线上安装建议采取编译安装的方法,这样性能上有较大提升,,源码包的编译参数会默认以Debgu模式生成二进制代码,而Debug模式给MySQL带来的性能损失是比较大的,所以当我们编译准备安装的产品代码时,一定不要忘记使用“—without-debug”参数禁用Debug模式。

而如果把—with-mysqld-ldflags和—with-client-ldflags二个编译参数设置为—all-static的话,可以告诉编译器以静态方式编译和编译结果代码得到最高的性能。

使用静态编译和使用动态编译的代码相比,性能差距可能会达到5%至10%之多。

编译参数如下所示(适合5.4及之前的版本):

./configure --prefix=/usr/local/mysql \
--without-debug \
--without-bench \
--enable-thread-safe-client \
--enable-assembler \
--enable-profiling \
--enable-community-features \
--with-mysqld-ldflags=-all-static \
--with-client-ldflags=-all-static \
--with-charset=utf8 \ #具体看网站环境决定默认编码
--with-extra-charset=all \
--with-innodb \    #个人博客可以不开启innodb
--with-csv-storage-engine \
--with-federated-storage-engine \
--with-mysqld-user=mysql \
--without-embedded-server \
--with-server-suffix=-community \
--with-unix-socket-path=/usr/local/mysql/sock/mysql.sock
Copy after login

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!