官方下载地址

编译安装MySQL

tar zxf mysql-5.5.22.tar.gz cd mysql-5.5.22
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_UNIX_ADDR=/tmp/mysql.sock -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS=all -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_READLINE=1 -DENABLED_LOCAL_INFILE=1 -DMYSQL_DATADIR=/usr/local/mysql/data -DMYSQL_USER=mysql
gmake && gmake install

配置环境

cp -f support-files/my-medium.cnf /etc/my.cnf
mkdir /usr/local/mysql/var
chmod +w /usr/local/mysql
chown -R mysql:mysql /usr/local/mysql
cat > /etc/ld.so.conf.d/mysql.conf << EOF
/usr/local/mysql/lib
/usr/local/lib
EOF
/sbin/ldconfig
cp -f support-files/mysql.server /etc/init.d/mysqld
chmod +x /etc/init.d/mysqld
chkconfig --add mysqld
chkconfig --level 3 mysqld on