操作系统 
首页 > 操作系统 > 浏览文章

centos 7 安装percona Server 服务器方法

(编辑:jimmy 日期: 2024/10/3 浏览:3 次 )

如何在 CentOS 7 上安装 Percona服务器?其实也是非常简单的,Percona Server提升了在高负载情况下的 InnoDB 的性能,为 DBA 提供了一些非常有用的性能诊断工具,另外有更多的参数和命令来控制服务器行为。

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
上一篇:centos7如何修改系统默认语言
下一篇:CentOS添加用户到sudoer列表教程
一句话新闻
高通与谷歌联手!首款骁龙PC优化Chrome浏览器发布
高通和谷歌日前宣布,推出首次面向搭载骁龙的Windows PC的优化版Chrome浏览器。
在对骁龙X Elite参考设计的初步测试中,全新的Chrome浏览器在Speedometer 2.1基准测试中实现了显著的性能提升。
预计在2024年年中之前,搭载骁龙X Elite计算平台的PC将面世。该浏览器的提前问世,有助于骁龙PC问世就获得满血表现。
谷歌高级副总裁Hiroshi Lockheimer表示,此次与高通的合作将有助于确保Chrome用户在当前ARM兼容的PC上获得最佳的浏览体验。