rpm -qa | grep mysql
yum -y install make gcc-c++ cmake bison-devel ncurses-devel
cd ..
tar xf mysql-5.6.29.tar.gz
cd mysql-5.6.29
cmake \
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DMYSQL_DATADIR=/usr/local/mysql/data \
-DSYSCONFDIR=/etc \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_MEMORY_STORAGE_ENGINE=1 \
-DWITH_READLINE=1 \
-DMYSQL_UNIX_ADDR=/var/lib/mysql/mysql.sock \
-DMYSQL_TCP_PORT=3306 \
-DENABLED_LOCAL_INFILE=1 \
-DWITH_PARTITION_STORAGE_ENGINE=1 \
-DEXTRA_CHARSETS=all \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci
make
make install
groupadd mysql
useradd -g mysql -s /sbin/nologin -M mysql
chown -R mysql:mysql /usr/local/mysql
cd /usr/local/mysql
scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --user=mysql
cp support-files/mysql.server /etc/init.d/mysql
chkconfig mysql on
cd /etc
mv my.cnf my.cnf.bak
service mysql start
vim /etc/profile
PATH=/usr/local/mysql/bin:$PATH
export PATH
source /etc/profile
mysql -uroot
本文转自 meteor_hy 51CTO博客,原文链接:http://blog.51cto.com/zuoshou/1879698,如需转载请自行联系原作者