分类: Mysql/postgreSQL
2011-05-26 13:17:29
安装步骤 参考于 官方INSTALL-BINARY
系统:red hat 5.3 64位
Percona版本:Percona-Server-5.5.11-rel20.2-116.Linux.x86_64
下载地址:
1、上传二进制包文件到系统下,可以自己选择上传目录,我的在/root/work/software/mysql
2、解压文件到安装路径下
[root@DB-m mysql]# tar zvxf Percona-Server-5.5.11-rel20.2-116.Linux.x86_64.tar.gz
[root@DB-m mysql]# mv Percona-Server-5.5.11-rel20.2-116.Linux.x86_64 /usr/local/mysql
3、安装
[root@DB-m mysql]# groupadd mysql
[root@DB-m mysql]# useradd -r -g mysql mysql
[root@DB-m mysql]# cd /usr/local/mysql/
[root@DB-m mysql]# chown -R mysql .
[root@DB-m mysql]# chgrp -R mysql .
[root@DB-m mysql]# scripts/mysql_install_db --user=mysql
[root@DB-m mysql]# chown -R root .
[root@DB-m mysql]# chown -R mysql data
[root@DB-m mysql]# cp support-files/my-medium.cnf /etc/my.cnf
[root@DB-m mysql]# bin/mysqld_safe --user=mysql &
[root@DB-m mysql]# cp support-files/mysql.server /etc/init.d/mysql
拷贝文件,允许在任何路径下使用mysql命令进入命令行
[root@DB-m ~]# cp /usr/local/mysql/bin/mysql /usr/sbin/
4、调整启动脚本 mysql.server 文件,将默认路径替换成 实际安装路径,否则会报错
/etc/init.d/mysql: line 256: my_print_defaults: command not found
[root@DB-m mysql]# vi /etc/init.d/mysql
--------文件 65 - 74 行,原始内容
then
basedir=/usr/local/Percona-Server-5.5.11-rel20.2-116.Linux.x86_64
bindir=/usr/local/Percona-Server-5.5.11-rel20.2-116.Linux.x86_64/bin
if test -z "$datadir"
then
datadir=/usr/local/Percona-Server-5.5.11-rel20.2-116.Linux.x86_64/data
fi
sbindir=/usr/local/Percona-Server-5.5.11-rel20.2-116.Linux.x86_64/bin
libexecdir=/usr/local/Percona-Server-5.5.11-rel20.2-116.Linux.x86_64/bin
else
-------65 - 74 行,修改后
then
basedir=/usr/local/mysql
bindir=/usr/local/mysql/bin
if test -z "$datadir"
then
datadir=/usr/local/mysql/data
fi
sbindir=/usr/local/mysql/bin
libexecdir=/usr/local/mysql/bin
else
-------检查重启操作
[root@DB-m ~]# service mysql stop
Shutting down MySQL (Percona Server). [ OK ]
[root@DB-m ~]# service mysql start
Starting MySQL (Percona Server).. [ OK ]
[root@DB-m ~]#