1. Download the source package
MySQL 5.5.42
Http://mysql.mirror.kangaroot.net/Downloads/MySQL-5.5/mysql-5.5.42.tar.gz
CMake 3.2.1
Http://www.cmake.org/files/v3.2/cmake-3.2.1.tar.gz
2. Check the Environment:
Rpm-qa | grep cmake
Rpm-qa | grep gcc
Rpm-qa | grep gcc-c++
3. Installation article:
cmake-3.2.1
Upload cmake-3.2.1.tar.gz to/usr/local/src via Xftp
#tar ZXVF cmake-3.2.1.tar.gz
#cd/usr/local/src/cmake-3.2.1
#./configure--prefix=/usr/local/cmake
#make && make Install
#vim ~/.bash_profile
Modify path= $PATH: $HOME/bin
paht= $PATH: $HOME/bin:/usr/local/cmake/bin
Save exit
#source ~/.bash_profile
mysql-5.5.42
#cd/usr/local/src/
#tar ZXVF mysql-5.5.42.tar.gz
#cd mysql-5.5.42
#useradd-R-s/sbin/nologin MySQL
#cmake. -dcmake_install_prefix=/usr/local/mysql-dmysql_datadir=/data/mysql-dsysconfdir=/etc-dwith_innobase_storage_ Engine=1-dwith_archive_storage_engine=1-dwith_blackhole_storage_engine=1-dwith_federated_storage_engine=1- Dwith_partition_storage_enging=1-dmysql_unix_addr=/tmp/mysqld.sock-denabled_local_infile=1-dextra_charsets=all -dmysql_user=mysql
#gmake
#make Install
#cd/usr/local/mysql
#cd support-files/
#ls Mysql.server (see if x permission is available)
#cp Mysql.server/etc/init.d/mysql
#cp my-large.cnf/etc/my.cnf
#vim/etc/my.cnf
Add the following line:
Basedir =/usr/local/mysql
DataDir =/data/mysql
Socker =/tmp/mysqld.sock
Port = 3306
Save exit
#mkdir-P/data/mysql
#chown-R MySQL. /data/mysql
#cd/usr/local/mysql/scripts/
#./mysql_install_db--basedir=/usr/local/mysql/--datadir=/data/mysql/--no-defaults--user=mysql
#cd/data/mysql
#ls
#service MySQL Start
#ps-ef | grep MySQL (see if there is a MySQL process)
#vim ~/.bash_profile
Append ":/usr/local/mysql/bin" after the path variable, and the result of the modification is as follows:
Path= $PATH: $HOME/bin:/usr/local/cmake/bin:/usr/local/mysql/bin (Note:/usr/local/cmake/bin directory for this experiment compiles the directory generated by the installation, If your cmake is installed via RPM or yum, there is no such path. Path= $PATH: $HOME/bin:/usr/local/mysql/bin)
#source ~/.bash_profile
You can also modify global variables
#vim/ETC/BASHRC
At the end of the add
Path= $PATH:/usr/local/mysql/bin:/usr/local/cmake/bin (Note:/usr/local/cmake/bin The directory generated for this experiment to compile the installation. )
#mysql
Mysql>\s
This article is from the "Lot" blog, please be sure to keep this source http://6294180.blog.51cto.com/6284180/1627922
CentOS 5.5 64bit under source code compilation install MySQL 5.5.42