#安装包:
Percona-Server-5.6.21-70.0-r688-el6-x86_64-bundle.tar
#首先安装cmake
yum -y install cmake
#对于 Fedora 20 和 CentOS 7 需要另外安装一个 perl-Data-Dumper 包:
Yum install perl-Data-Dumper
cd /usr/local/src/
mkdir mysql-percona
cd mysql-percona/
#rz 上传安装包
tar -xvf Percona-Server-5.6.21-70.0-r688-el6-x86_64-bundle.tar
rpm -ivh Percona-Server-shared-56-5.6.21-rel70.0.el6.x86_64.rpm
rpm -ivh Percona-Server-client-56-5.6.21-rel70.0.el6.x86_64.rpm
rpm -ivh Percona-Server-server-56-5.6.21-rel70.0.el6.x86_64.rpm
#启动:
service mysql start
#修改root密码:
mysqladmin -u root password "root"
#登录:
mysql -uroot -proot
#设置远程访问(使用root密码):
grant all privileges on *.* to 'root' @'%' identified by 'root';
flush privileges;
#防火墙打开3306端口
/sbin/iptables -I INPUT -p tcp --dport 3306 -j ACCEPT
/etc/rc.d/init.d/iptables save
/etc/init.d/iptables status
#卸载:
yum remove Percona-Server* -y
rm -rf /var/lib/mysql
rm -f /etc/my.cnf
#补充:
rpm -ivh Percona-Server-server-56-5.6.21-rel70.0.el6.x86_64.rpm
上面这一步安装服务端时候,可能会出现异常:…………conflicts with file from package xxx
那是因为之前没卸载干净,使用命令删除package后面的包:yum -y remove xxx