1. Upload mysql-5.5.21.tar.gz and cmake-2.8.3.tar.gz to the/usr/local folder. 2.CentOS mounting g++ and Ncurses-devel
[Email protected] local]# yum-y install gcc-c++
[Email protected] local]# yum-y install Ncurses-devel
Installation of 3.cmake
[[Email protected]]# tar-zxv-f cmake-2.8.10.2.tar.gz//Decompression Pack
[Email protected] local]# CD cmake-2.8.10.2
[Email protected] cmake-2.8.10.2]#./configure
[[email protected] cmake-2.8.10.2]# make
[[email protected] cmake-2.8.10.2]# make install
4. Permanently add cmake to the system environment variable
Add the variable in the file/etc/profile file with VI to make it permanent and effective,
[[email protected] local]# vi/etc/profile (do not use the VI command, you can find the/etc/profile corresponding file, edit the file)
Append the following two lines of code to the end of the file:
Path=/usr/local/cmake-2.8.10.2/bin: $PATH
Export PATH
Execute the following code to make the changes take effect:
[Email protected] local]# Source/etc/profile
To view the path value with the Export command
[Email protected] local]# echo $PATH
5. Create a MySQL installation directory and database storage directory
[Email protected]]# mkdir-p/usr/local/mysql
[[Email protected]]# mkdir-p/usr/local/mysql/data//Storage database
6. Create MySQL users and user groups
[[email protected]] Groupadd MySQL
[[email protected]] useradd-r-g MySQL MySQL
7. Compile and install MySQL
[[email protected] local]# tar-zxv-f mysql-5.5.21.tar.gz//Unzip
[Email protected] local]# CD mysql-5.5.21
[Email protected] mysql-5.5.21]#
Cmake-dcmake_install_prefix=/usr/local/mysql \
-dmysql_unix_addr=/usr/local/mysql/mysql.sock \
-ddefault_charset=utf8 \
-DDEFAULT_COLLATION=UTF8_GENERAL_CI \
-dwith_myisam_storage_engine=1 \
-dwith_innobase_storage_engine=1 \
-dwith_memory_storage_engine=1 \
-dwith_readline=1 \
-denabled_local_infile=1 \
-dmysql_datadir=/usr/local/mysql/data \
-dmysql_user=mysql \
-dmysql_tcp_port=3306
[[email protected] mysql-5.5.21]# make
[[email protected] mysql-5.5.21]# make install
8. Verify the installation is successful
[Email protected] mysql-5.5.29]# cd/usr/local/mysql/
[[email protected] mysql]# ls
Bin COPYING data docs include Install-binary lib man mysql-test README scripts share Sql-bench support-files
Have bin and other documents, congratulations you have successfully installed the MySQL
This digest from: http://www.cnblogs.com/zhoulf/archive/2013/01/25/zhoulf.html