1、安装cmake
Wget http://www.cmake.org/files/v2.8/cmake-2.8.5-Linux-i386.sh
chmod +xcmake-2.8.5-Linux-i386.sh
./cmake-2.8.5-Linux-i386.sh --prefix=/usr/local/
2、安装gmake, gcc, perl, ncurses,bison,可以直接使用yum来安装
Yuminstall make gcc* perl* ncurses ncurses-devel bisonbison-devel -y
二、开始安装mysql5.5
1、创建用于运行mysql的用户
Useradd mysql
2、下载
Wget http://mysql.cs.pu.edu.tw/Downloads/MySQL-5.5/mysql-5.5.15.tar.gz
3、解压缩
tar zxvfmysql-5.5.15.tar.gz
4、配置,编译并安装
cdmysql-5.5.15
Cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DMYSQL_DATADIR=/usr/local/mysql/mysqldata\
-DSYSCONFDIR=/etc\
-DDEFAULT_CHARSET=utf8\
-DDEFAULT_COLLATION=utf8_general_ci\
-DMYSQL_USER=mysql
make &make install
Chown -Rmysql:mysql /usr/local/mysql/data
5、配置启动MySQL
1、拷贝配置文件
Cd /usr/local/mysql/support-files
Cp my-large.cnf /etc/my.cnf
Cp mysql.server /etc/init.d/mysqld
2、初始化安装
/usr/local/mysql/scripts/mysql_install_db --user=mysql --datadir=/usr/local/mysql/data \
--basedir=/usr/local/mysql
3、将mysql配置成sysV服务
编辑/etc/init.d/mysqld,设置以下变量的值:
Basedir = /usr/local/mysql
Datadir = /usr/local/mysql/data
加入开机自启动
Chkconfig --add mysqld
Chkconfig --level 345 mysqld on
4、启动MySQL
Service mysqld start