MySQL optimization is divided into three parts
1. Optimization of physical server hardware
MySQL every second, a large number of complex query operations, the disk of the 1/o has a high demand, usually considered 1/o is the most restrictive MySQL performance factor.
2.mysql Compile optimization at installation
--static static links Improve 13% performance
--with-client-ldflags=-all-static
--with-mysqld-ldflags=-all-static
--PGCC if it is a inter processor, use PGCC to improve 1% performance
cflags= "-o3-mpentiumpro-mstack-align-double" CXX=GCC \
cxxflags= "-o3-mpentiumpro-mstack-align-double \
--felide-constructors-fno-exceptions-fno-rtti "
UNIX Sockets use UNIX socket links to improve 7.5% performance, so MySQL performance under Windows is certainly not as good as under Unix
--with-unix-socket-path=/usr/local/mysql/tmp/mysql.sock
--enable-assembler allows assembly mode (optimized performance)
--without-debug compile the installation by default debug mode generates binary code, which can cause a lot of performance loss to MySQL
3. Optimization of its own configuration file see the following configuration document
------------------------------------------------------------------------
Operating system and its MySQL configuration file description
System: Centos5.5
Mysql:mysql-5.1.58.tar.gz Source Pack
Installation directory:/usr/local/mysql/
Data directory:/data/mysql/3306/data/
Binary log:/data/msyql/3306/binlog/
Relay log:/data/mysql/3306/relaylog/
Configuration file:/data/mysql/3306/my.cnf
Mysql.sock File:/data/mysql/3306/mysql.sock
------------------------------------------------------------------------
1. Install GCC Ncurses-devel
Yum-y Install GCC Ncurses-devel
2. Create user
/usr/sbin/groupadd MySQL
/usr/sbin/useradd-s/sbin/nologin-g mysql-m MySQL