发布于 2014-12-12 10:13:39 | 1184 次阅读 | 评论: 0 | 来源: PHPERZ

这里有新鲜出炉的精品教程,程序狗速度看过来!

Percona Server Mysql分支数据库

Percona Server是MySQL的改进版本,使用 XtraDB 存储引擎,在功能和性能上较 MySQL 有着很显著的提升,如提升了在高负载情况下的 InnoDB 的性能,为 DBA 提供了一些非常有用的性能诊断工具,另外有更多的参数和命令来控制服务器行为。


本文为大家讲解的是在CentOS 7 下安装 Percona Server 5.6数据库的方法,感兴趣的同学参考下.

Percona Server简介

Percona Server是MySQL的改进版本,使用 XtraDB 存储引擎,在功能和性能上较 MySQL 有着很显著的提升,如提升了在高负载情况下的 InnoDB 的性能,为 DBA 提供了一些非常有用的性能诊断工具,另外有更多的参数和命令来控制服务器行为。

Percona Server安装

平台说明:

centos 7 ,Percona Server 5.6

执行用户 root , 安装使用用户 centralight


1.更新yum

yum install http://www.percona.com/downloads/percona-release/redhat/0.1-3/percona-release-0.1-3.noarch.rpm


2.安装

yum install Percona-Server-client-56 Percona-Server-server-56

安装如果有冲突,之前已经安装过mysql,则需要卸载 

rpm -qa | grep mysql
rpm -qa | grep mariadb
rpm -e [软件标识]


3.非多实例配置及启动

默认配置文件路径 /etc/my.cnf

初始化
mysql_install_db --user=centralight --datadir=/cl/data/mysql/percona3311
启动
mysqld_safe  --user=centralight --datadir=/cl/data/mysql  --defaults-file=/cl/dist/conf/mysql/my.cnf

4.多实例配置及启动

chown -R centralight /cl/data/mysql/percona3311
mysql_install_db --datadir=/cl/data/mysql/percona3311 --user=centralight


所有配置文件目录
默认配置文件路径 /etc/my.cnf,修改成如下

[client] 
user = root 
password = 123 
# Here follows entries for some specific programs 
[mysqld_multi] 
mysqld     = /usr/bin/mysqld_safe 
mysqladmin = /usr/bin/mysqladmin 
 
[mysqld3311] 
socket     = /var/lib/mysql/mysql3311.sock 
port       = 3311 
datadir    = /cl/data/mysql/percona3311
pid-file   = /var/lib/mysql/hostname.pid3311 
user       = centralight
 
skip-external-locking 
key_buffer_size = 16M 
max_allowed_packet = 1M 
table_open_cache = 64 
sort_buffer_size = 512K


启动
mysqld_multi --defaults-file=/etc/my.cnf --log=/cl/log/mysql/mysql.log start 3311
报告状态
mysqld_multi --defaults-file=/etc/my.cnf report 3311
 

5.登陆数据库修改用户及权限,并能远程连接

mysql -uroot -p -h127.0.0.1 -P3311
mysql> use mysql;
mysql> update user set host='%’ where host = ‘localhost’ and user=‘root’
mysql> flush privileges;

 

设置密码

mysql> UPDATE user SET Password=password("123") WHERE user='root' and host='%’;
mysql> flush privileges;

如果不能远程连接,请关闭防火墙尝试

CentOS 7.0默认使用的是firewall作为防火墙

systemctl stop firewalld.service 
systemctl disable firewalld.service



最新网友评论  共有(0)条评论 发布评论 返回顶部

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务