系统环境,请查看《virtualbox5.0.8 centos6.7 mini 安装》
准备源码包mysql-5.6.19.tar.gz ,上传至/opt 目录
groupadd mysql
useradd -g mysql mysql -s /bin/false
mkdir -p /data/mysql
chown -R mysql:mysql /data/mysql
mkdir -p /usr/local/mysql
yum -y install autoconf
cd mysql-5.6.19
cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/data/mysql -DSYSCONFDIR=/etc
make && make install
cd /usr/local/mysql
./scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/data/mysql
rm -f /etc/my.cnf
ln -s /usr/local/mysql/my.cnf /etc/my.cnf
cp ./support-files/mysql.server /etc/rc.d/init.d/mysqld
chmod 755 /etc/init.d/mysqld
chkconfig mysqld on
vi /etc/rc.d/init.d/mysqld
basedir=/usr/local/mysql
datadir=/data/mysql
vi /etc/profile
export PATH=$PATH:/usr/local/mysql/bin
source /etc/profile