Summary of compilation and installation parameters recommended for MySQL database Optimization
MySQL compilation parameters are many and complex, which makes new users feel very proud. If MySQL is installed in a formally generated environment, there is not enough time to study the meaning of each parameter, I personally suggest using compilation parameters compiled by Yu hongchun, which is convenient and efficient!
We recommend that you compile and install MySQL for online installation. This greatly improves the performance. The compilation parameters of the source code package will generate binary code in Debgu mode by default, the Debug mode causes a high performance loss to MySQL. Therefore, when compiling the product code to be installed, do not forget to use the "-without-debug" parameter to disable the Debug mode.
If you set the compilation parameters-with-mysqld-ldflags and-with-client-ldflags to-all-static, it can tell the compiler to compile and compile the result code in static mode to achieve the highest performance.
Compared with code that uses static compilation and dynamic compilation, the performance gap may reach 5% to 10%.
The compilation parameters are as follows (applicable to versions 5.4 and earlier ):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
./Configure -- prefix =/usr/local/mysql \ -- Without-debug \ -- Without-example \ -- Enable-thread-safe-client \ -- Enable-Cycler \ -- Enable-profiling \ -- Enable-community-features \ -- With-mysqld-ldflags =-all-static \ -- With-client-ldflags =-all-static \ -- With-charset = utf8 \ # depending on the website environment, the default encoding is determined. -- With-extra-charset = all \ -- With-innodb \ # A personal blog may not enable 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 |