Installation Environment:
System: Red Hat Enterprise Linux Server Release 6.5
Kernel: 2.6.32-431.el6.x86_64
Mysql:mysql-5.5.28.tar.gz
Cmake:cmake-2.8.10.2.tar.gz
Steps:
First, the installation of cmake:mysql5.5 version requires the use of CMake compilation
# tar XVF cmake-2.8.10.2.tar.gz
# CD cmake-2.8.10.2
#./configure
# Make && make install
Second, compile and install MySQL
1. Set up Data Catalog
# mkdir-p/data/mydata #数据目录可任意定义
2. Create MySQL users and groups
# groupadd-r MySQL
# useradd-g Mysql-r-d/data/mydata MySQL
3. Compile and install MySQL
# tar XVF mysql-5.5.28.tar.gz
# CD mysql-5.5.28
# CMake. -dcmake_install_prefix=/usr/local/mysql \ #安装目录
-dmysql_datadir=/data/mydata \ #数据存储路径
-DSYSCONFDIR=/ETC \ #配置文件目录
-dwith_innobase_storage_engine=1 \ #包含INNODB存储引擎
-dwith_archive_storage_engine=1 \ #包含ARCHIVE存储引擎
-dwith_blackhole_storage_engine=1 \ #黑洞存储引擎
-dwith_readline=1 \
-dwith_ssl=system \
-dwith_zlib=system \
-dwith_libwrap=0 \
-dmysql_unix_addr=/tmp/mysql.sock \ #套接字路径
-ddefault_charset=utf8 \ #默认字符集
-ddefault_collation=utf8_general_ci
# make
# make Install
4. Configure the environment, change the configuration file
# Cd/usr/local/mysql
# chown-r: MySQL./
# scripts/mysql_install_db--user=mysql--datadir=/data/mydata #执行scripts目录下的脚本
# CP Support-files/my-large.cnf-a/ETC/MY.CNF
# CP Support-files/mysql.server-a/etc/init.d/mysqld
# chkconfig--add mysqld
# vim/etc/profile.d/mysql.sh #这个问价你需要手动建立, add the client command to the environment variable.
Export path= $PATH:/usr/local/mysql/bin
# . /etc/profile.d/mysql.sh #执行脚本让他生效, "." There are spaces behind.
# VIM/ETC/MY.CNF
Thread_concurrency = 4 #指定线程数
DataDir =/data/mydata
This article is from the "Sky.sui" blog, make sure to keep this source http://169293.blog.51cto.com/159293/1981242
Compiling and installing MySQL-5.5.28