Yum Install CMake ncurses-devel gcc-c++-y
wget http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.41.tar.gz
Tar xzvf mysql-5.5.41.tar.gz
CD mysql-5.5.41
Useradd-m-s/sbin/nologin MySQL
Cmake-dcmake_install_prefix=/usr/local/mysql \
-dmysql_unix_addr=/data/mysql/mysql.sock \
-ddefault_charset=utf8 \
-DDEFAULT_COLLATION=UTF8_GENERAL_CI \
-DWITH_EXTRA_CHARSETS:STRING=UTF8,GBK \
-dwith_innobase_storage_engine=on \
-denabled_local_infile=1 \
-dmysql_datadir=/data/mysql \
-dmysql_tcp_port=3306 \
-dwith_partition_storage_engine=1
Make $$ make install
#初始化数据库
Cd/usr/local/mysql/bin
scripts/mysql_install_db--user=mysql--basedir=/usr/local/mysql--datadir=/data/mysql/
Cd/usr/local/mysql
CP support-files/my-medium.cnf/etc/my.cnf Copy configuration file
CP support-files/mysql-server/etc/init.d/mysqld Copy to System
chmod 755/etc/init.d/mysqld Modifying properties
Chkconfig--add/etc/init.d/mysqld-------added as a service
Chkconfig mysqld--level 235 on set at level 235 is automatically run on boot
#配置环境
Add the Bin directory of the #将mysql to path and add Myslq/bin to the/etc/profile
Export Path=/usr/local/mysql/bin: $PATH
Compiling and installing mysql5.5