#安装CMake
#安装依赖包
Yum Install gcc-c++ Ncurses-devel–y
#安装脚本:
Tar XF cmake-2.8.8.tar.gz
CD cmake-2.8.8
./configure
Gmake
Gmake Install
Cd.. /
# Create MySQL users and Groups
Groupadd MySQL
Useradd mysql-s/sbin/nologin-m-G MySQL
#Unzip the compilationMysql
# Specify character Set
#-ddefault_charset=utf8 \
#-ddefault_collation=utf8_general_ci \
Tar zxf mysql-5.5.32.tar.gz
CD mysql-5.5.32
CMake.-dcmake_install_prefix=/application/mysql-5.5.32 \
-dmysql_datadir=/application/mysql-5.5.32/data \
-dmysql_unix_addr=/application/mysql-5.5.32/tmp/mysql.sock\
-DEXTRA_CHARSETS=GBK,GB2312,UTF8,ASCII \
-denabled_local_infile=on \
-dwith_innobase_storage_engine=1 \
-dwith_federated_storage_engine=1 \
-dwith_blackhole_storage_engine=1 \
-dwithout_example_storage_engine=1 \
-dwithout_partition_storage_engine=1 \
-dwith_fast_mutexes=1 \
-dwith_zlib=bundled \
-denabled_local_infile=1 \
-dwith_readline=1 \
-dwith_embedded_server=1 \
-dwith_debug=0
#--Build files have been written to:/home/oldboy/tools/mysql-5.5.32
#提示, there are many options to configure at compile time, refer to the end of the appendix or official documentation:
Make
#[100%] Built Target my_safe_process
Make install
Ln-s/application/mysql-5.5.32//application/mysql
#Select a configuration file
/BIN/CP support-files/my-small.cnf/etc/my.cnf
#Multi-instance configuration environment variables#Method One
Echo ' Export path=/application/mysql/bin: $PATH ' >>/etc/profile
Echo ' Tail-1/etc/profile '
Source/etc/profile
Echo $PATH
#Method Two
# Copy the commands below/usr/local/mysql/bin to the Global System command path/usr/local/sbin, or link connection
# The path is not correct, before compiling the installation there is yum install MySQL, workaround
# http://oldboy.blog.51cto.com/2361410/1122867
#Initializing the database
/bin/sh/application/mysql/scripts/mysql_install_db--basedir=/application/mysql/--datadir=/application/mysql/ data/--user=mysql
# Copy MySQL start the script to INIT.D , and authorize
/bin/cp/root/tools/mysql-5.5.32/support-files/mysql.server/etc/init.d/mysqld
chmod +x/etc/init.d/mysqld
echo "Ll/etc/init.d/mysql"
Echo ' Ll/etc/init.d/mysqld '
find/data/-type f-name "MySQL" |xargs chmod +x
#Start the database
/etc/init.d/mysqld start
Netstat-lntup |grep 3306
Lsof-i: 3306
# Start the database
/etc/init.d/mysqld start
Netstat-lntup |grep 3306
Lsof-i: 3306
This article is from the "it1693" blog, make sure to keep this source http://it1693.blog.51cto.com/2342744/1692982
Compile and install MySQL