Source: http://www.cnblogs.com/chenjunbiao/archive/2011/01/24/1940256.html
Installation environment: Linux Server CentOS 5.5
Installed version: mysql-5.5.8.tar.gz
1, install the CMake compiler.
1), download CMake
#cd/usr/local/src#wget http://www.cmake.org/files/v2.8/cmake-2.8.4.tar.gz
2), decompression CMake
#tar-ZVXF cmake-2.8.4.tar.gz
3), configuration compilation
#cd cmake-2.8.4#yum-y Install gcc#yum-y install gcc-c++ #yum-y install ncurses-devel#./configure#make#make Install
2. Install MySQL
1), download MySQL.
#cd/usr/local/src#wget http://sdk.ruiya.com/linux/mysql-5.5.9.tar.gz
2), add the necessary groups and owners
#groupadd mysql#useradd-r-G MySQL MySQL
3), unzip MySQL
#tar-ZVXF mysql-5.5.9.tar.gz
4), configuration compilation
If you are reloading MySQL, please remove my.cnf first, such as: RM-RF/ETC/MY.CNF
#mkdir/usr/local/mysql#mkdir/usr/local/mysql/data#cd/usr/local/src/mysql-5.5.9#cmake. -dcmake_install_prefix=/usr/local/mysql-dinstall_datadir=/usr/local/mysql/data-ddefault_charset=utf8-ddefault_ Collation=utf8_general_ci-dextra_charsets=all-denabled_local_infile=1#make#make Install
Parameter description:
-dcmake_install_prefix=/usr/local/mysql // installation directory -dinstall_datadir=/usr/local/ MySQL/data // Database storage directory -ddefault_charset=utf8 // use UTF8 characters - Ddefault_collation=utf8_general_ci // check character -dextra_charsets=all // Install all extended character sets -denabled_local_infile=1 // allow import of data from local
Precautions:
When you recompile, you need to clear the old object file and cache information.
# Make clean# rm-f
4), set directory permissions
# cd/usr/local/mysql# Chown-r Root:mysql. Set the owner owner of all files in the current directory to root, and the group mysql# chown-r mysql:mysql data
5), configuration file
# CP SUPPORT-FILES/MY-MEDIUM.CNF/ETC/MY.CNF//This configuration is only suitable for small memory systems (32M-64M)
Open the following comment:
Innodb_data_home_dir =/usr/local/mysql/= ibdata1:10m:=/usr/local/mysql/ = = = = = 1= 50
Install MySQL under Linux