1.下载cmake: http://wwwNaNake.org/files/v2.8/cmake-2.8.10.2.tar.gz
./configure
make && make install
2.vi /etc/profile:
export PATH=/usr/local/cmake-2.8.10.2/bin:$PATH
source /etc/profile
3.wget http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.37.tar.gz
4.tar -zxvf mysql-5.5.37.tar.gz
cd mysql-5.5.37
5.cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DMYSQL_DATADIR=/usr/local/mysql/data \
-DSYSCONFDIR=/usr/local/mysql/etc \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_ARCHIVE_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DWITH_MEMORY_STORAGE_ENGINE=1 \
-DWITH_PARTITION_STORAGE_ENGINE=1 \
-DWITH_FEDERATED_STORAGE_ENGINE=1 \
-DWITH_READLINE=1 \
-DWITH_EMBEDDED_SERVER=1 \
-DENABLED_LOCAL_INFILE=1 \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DWITH_EXTRA_CHARSETS=all \
-DWITH_ZLIB=system \
-DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock \
-DWITH_READLINE=1 \
-DWITH_READLINE=1 \
-DMYSQL_USER=mysql \
-DMYSQL_TCP_PORT=3306 \
-DWITH_DEBUG=0 \
-DENABLE_DOWNLOADS=1
6.cd /usr/local/mysql
chown -R root:mysql .
chown -R mysql:mysql data
7.mv /etc/my.cnf /etc/my.cnf.bak
cp -p support-files/my-huge.cnf /etc/my.cnf
8.cd /usr/local/mysql
scripts/mysql_install_db --user=mysql
9.vi /root/.bash_profile,修改为:
PATH=$PATH:$HOME/bin:/usr/local/mysql/bin:/usr/local/mysql/lib
Source /root/.bash_profile
10.cd /usr/local/mysql
./bin/mysqld_safe --user=root &
/usr/local/mysql/bin/mysqladmin -u root -p shutdown
11.cd /usr/local/mysql/
cp support-files/mysql.server /etc/init.d/mysql
chown -R mysql:mysql /usr/local/mysql
/etc/init.d/mysql/start
12.vi /etc/sysconfig/iptables:
添加:
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
/etc/init.d/iptables restart