2012年(7)
分类: Mysql/postgreSQL
2012-09-11 14:10:11
yum install make gcc gcc-c++ ncurses ncurses-devel bison
2、下载源码,编译安装
wget
tar zxvf Percona-Server-5.5.27-rel28.1.tar.gz
cd Percona-Server-5.5.27-rel28.1
设置变量、创建安装路径:
INSTALL_PATH=/data/usr/percona #设置安装路径
创建mysql组和用户
useradd -r -M -s /sbin/nologin mysql
编译安装:
cmake . \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DBUILD_CONFIG=mysql_release \
-DFEATURE_SET=community \
-DWITH_EMBEDDED_SERVER=OFF \
-DCMAKE_INSTALL_PREFIX=$INSTALL_PATH \
make && make install
3、配置
chown -R msyql:mysql /data/usr/percona
安装系统表:
cd /data/usr/percona
sh scripts/mysql_install_db --user=mysql
chown -R root /data/usr/percona
chown -R mysql:mysql /data/usr/percona/data
配置my.cnf配置文件:
cp support-files/my-medium.cnf /etc/my.cnf
配置mysql的service服务:
cp support-files/mysql.server /etc/init.d/mysql.server
chmod a+x /etc/init.d/mysql.server
chkconfig --add mysql.server
修改mysql的root密码:
/data/usr/percona/bin/mysqladmin -uroot password ‘password’
4、启动mysql
/data/usr/percona/bin/mysqld_safe --user=mysql &
验证启动是否成功:
netstat -tunlp|grep 3306