First of all, here is the path, and the statements are in the Internet to see a lot of errors after their own practice after the change, I hope it is useful to everyone.
Here in the installation of the time to follow my order, otherwise it may be because of the path error can not find the corresponding instructions.
one, install cmake
# Install the required dependency package (this instruction is entered all the time)
Yum-y Install GCC Libxml2-dev Curl screen \
Libpng12-dev autoconf libpcre3-dev make bzip2 \
Libevent-dev Patch LIBJ Peg62-dev libcurl4-openssl-dev \
Libfreetype6-dev g++ libtool libncurses5-dev psmisc lrzsz
# download File
wget http://www.cmake.org/files/v2.8/cmake-2.8.5.tar.gz
# compile and install
Tar zxvf cmake-2.8.5.tar.gz
CD cmake-2.8.5
./boostrap
Make && make install
cmake–version
II, installation configuration MySQL
# Download source file
wget http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.17.tar.gz/from/ftp://ftp.ntu.edu.tw/pub/ mysql/
# Create users and Groups
Groupadd MySQL
useradd-g mysql -s/usr/sbin/nologin MySQL
# Create installation directory
mkdir /usr/local/mysql
# CREATE database directory
mkdir /usr/local/mysql/data
# unzip
TAR-ZXVF mysql-5.5.17.tar.gz
CD \mysql-5.5.17
# Compile and install MySQL
# CMake compile:
CMake .
Attention:
Here may be an error, if the error, then execute the statement after the compilation:
Rm-f CMakeCache.txt
Yum Install Ncurses-devel
# install MySQL
Make && make install
# Copy configuration file
CP SUPPORT-FILES/MY-MEDIUM.CNF/ETC/MY.CNF
# Set permissions
chmod +x/usr/local/mysql
Chown-r Mysql.mysql/usr/local/mysql
Chown-r Mysql:mysql/usr/local/mysql/data
# Configure boot from boot
CP Support-files/mysql.server/etc/init.d/mysqld
chmod +x/etc/init.d/mysqld
Chkconfig--Add mysqld
Chkconfg mysqld on
# Modify MY.CNF Configuration
Vim/etc/my.cnf
# [MYSQLD] Add:
Datadir=/usr/local/mysql/data
Default-storage-engine=myisam
# The following options are available:
Log-error =/usr/local/mysql/data/error.log
Pid-file =/usr/local/mysql/data/mysql.pid
user = MySQL
Tmpdir =/tmp
# Initialize Database
/usr/local/mysql/scripts/mysql_install_db--user=mysql--basedir=/usr/local/mysql--datadir=/usr/local/mysql/data &
# start MySQL
/usr/local/mysql/bin/mysqld_safe--DEFAULTS-FILE=/ETC/MY.CNF &
Or:
/etc/init.d/mysql Start (service MySQL start)
# test if MySQL is started
# 1) See if there is a process MySQL
Ps-ef | grep MySQL
# 2) See if the port is running
NETSTAT-TNL | grep 3306
# 3) Read MySQL version information
/usr/local/mysql/bin/mysqladmin version
# so far, MySQL installation is complete
Install MySQL under CentOS Server version