1.yum install gcc gcc-c++ make ncurses-devel bison openssl-devel zlib-devel
cmake
tar zxf cmake-2.8.4.tar.gz
cd cmake-2.8.4
./configure
gmake && gmake install
2.下载最新mysql
3.tar zxf mysql-5.5.12.tar.gz
4.cd mysql-5.5.12
5.cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DMYSQL_DATADIR=/usr/local/mysql/date \
-DMYSQL_UNIX_ADDR=/usr/local/mysql/date/mysql.sock \
-DWITH_MYISAM_STORAGE_ENGING=1 \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci -DEXTRA_CHARSETS=all
6make && make install
7.make clean
rm -f CmakeCache.txt
8 cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/usr/local/mysql/data -DMYSQL_UNIX_ADDR=/usr/local/mysql/data/mysql.sock -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DEXTRA_CHARSETS=all
9 make && make install
10. useradd -u 25 -M -s /sbin/nologin mysql
11groupmod -g 25 mysql
12 chown -R mysql.mysql /usr/local/mysql/
13 cd /root/mysql-5.5.12/support-files/
cp mysql.server /etc/init.d/mysqld
cd /u 14 cp my-medium.cnf /etc/my.cnf 根据你的主机内存复制mysqsl配置文件
15 cd ..
cd scripts/
16 ./mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
17 cd /usr/local/mysql
18 chown -R root .
19 chown -R mysql data/
20 cd /usr/local/mysql/support-files
21 cp mysql.server /etc/init.d/mysqld
22 cd /usr/local/mysql/bin
23 ln -s /usr/local/mysql/lib /usr/local/mysql/lib64
24 echo &PATH
25 vi ~/.bash_profile
PATH=$PATH:$HOME/bin:/usr/local/mysql/bin
26 source .bash_profile
27/etc/init.d/mysqld restart
转载于:https://blog.51cto.com/luoning504/710205