http://www.oracle.com/technetwork/indexes/downloads/index.html
1. wget 'http://cdn.mysql.com/Downloads/MySQL-5.5/mysql-5.5.28.tar.gz'
2. yum install cmake ncurses-devel gcc-c++ bison
3. tar zxvf mysql-5.5.25a.tar.gz
4. cd mysql-5.5.25a/
5. cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql-DMYSQL_DATADIR=/usr/local/mysql/data-DMYSQL_UNIX_ADDR=/usr/local/mysql/data/mysql.sock-DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1-DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1-DWITH_PARTITION_STORAGE_ENGINE=1 -DENABLED_LOCAL_INFILE=1 -DWITH_READLINE=1-DWITH_SSL=yes -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci-DEXTRA_CHARSETS=all -DMYSQL_TCP_PORT=3306
6. make
7. sudo make install
8. cp support-files/my-medium.cnf /etc/my.cnf
sudovim /etc/my.cnf
#在mysqld字段下加入以下内容
basedir=/usr/local/mysql
datadir=/usr/local/mysql/data
修改socket = /var/lib/mysql/mysql.sock
9. groupadd mysql
useradd -g mysql mysql
sudo chown -R root .
sudo chown -R mysql data
sudo chgrp -R mysql .
10. chmod +x scripts/mysql_install_db
11. sudo scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql--datadir=/usr/local/mysql/data
12. sudo /usr/local/mysql/bin/mysqld_safe &
13 sudo cp support-files/mysql.server /etc/init.d/mysqld
14 sudochmod 755 /etc/init.d/mysqld
15 export PATH=$PATH:/usr/local/mysql/bin:/usr/local/mysql/lib
16#设置root密码
mysqladmin-u root password "root"