聚合国内IT技术精华文章,分享IT技术精华,帮助IT从业人士成长

Centos 7.2安装Percona记录

2016-11-22 20:50 浏览: 11175 次 我要评论(0 条) 字号:

针对MySQL衍生版本选择MariaDB还是Percona目前还有很多不一致的观点,上一篇文章讲了如何在Centos 7.2系统上安装最新的MariaDB 10.1.19,这篇文章再来讲解下如何在CentOS 7.2上安装最新的 Percona 5.7。

方案一:通过yum安装

安装Percona源:

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

测试安装的源:

yum list | grep percona

完成后就可以直接进行安装:

yum install Percona-Server-server-57

启动、停止MySQL操作:

service mysql start
service mysql status
service mysql stop
service mysql resta
chkconfig mysqld on

如果需要安装TokuDB,执行:

yum install Percona-Server-tokudb-57.x86_64

然后设置初始密码:

mysql_secure_installation

发现这里的初始密码与并不为空,报错信息如下:

[root@localhost my.cnf.d]# mysql_secure_installation
Securing the MySQL server deployment.
Enter password for user root: 
Error: Access denied for user 'root'@'localhost' (using password: NO)

经过查询得知Percona 5.7安装时默认会产生个随机的密码,存在日志中,查看方法:

cat /var/log/mysqld.log  | grep "A temporary password" | awk -F " " '{print$11}'

参考链接:

  • https://www.percona.com/doc/percona-server/5.7/installation/yum_repo.html
  • https://www.percona.com/doc/percona-server/5.7/tokudb/tokudb_installation.html#tokudb-installation

在安装完成后再次执行

yum update
 会产生错误信息:

[root@localhost ~]# yum update
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.cn99.com
 * updates: mirrors.aliyun.com
Resolving Dependencies
--> Running transaction check
---> Package Percona-Server-shared-55.x86_64 0:5.5.53-rel38.4.el7 will be obsoleting
---> Package Percona-Server-shared-56.x86_64 0:5.6.33-rel79.0.el7 will be obsoleting
---> Package Percona-XtraDB-Cluster-shared-55.x86_64 1:5.5.41-25.12.855.el7 will be obsoleting
---> Package Percona-XtraDB-Cluster-shared-56.x86_64 1:5.6.32-25.17.1.el7 will be obsoleting
---> Package Percona-XtraDB-Cluster-shared-57.x86_64 0:5.7.14-26.17.1.el7 will be obsoleting
---> Package Percona-XtraDB-Cluster-shared-compat-57.x86_64 0:5.7.14-26.17.1.el7 will be obsoleting
---> Package mariadb-libs.x86_64 1:5.5.50-1.el7_2 will be obsoleted
---> Package percona-release.noarch 0:0.1-3 will be updated
---> Package percona-release.noarch 0:0.1-4 will be an update
--> Processing Conflict: Percona-Server-shared-compat-57-5.7.15-9.1.el7.x86_64 conflicts Percona-Server-shared-55
--> Processing Conflict: Percona-Server-shared-compat-57-5.7.15-9.1.el7.x86_64 conflicts Percona-Server-shared-56
--> Processing Conflict: Percona-XtraDB-Cluster-shared-compat-57-5.7.14-26.17.1.el7.x86_64 conflicts Percona-XtraDB-Cluster-shared-56
--> Processing Conflict: Percona-XtraDB-Cluster-shared-compat-57-5.7.14-26.17.1.el7.x86_64 conflicts Percona-XtraDB-Cluster-shared-55
--> Processing Conflict: 1:Percona-XtraDB-Cluster-shared-55-5.5.41-25.12.855.el7.x86_64 conflicts Percona-XtraDB-Cluster-shared-56
--> Processing Conflict: 1:Percona-XtraDB-Cluster-shared-55-5.5.41-25.12.855.el7.x86_64 conflicts Percona-Server-shared-55
--> Processing Conflict: 1:Percona-XtraDB-Cluster-shared-56-5.6.32-25.17.1.el7.x86_64 conflicts Percona-Server-shared-56
--> Processing Conflict: Percona-Server-shared-56-5.6.33-rel79.0.el7.x86_64 conflicts Percona-Server-shared-55
--> Processing Conflict: Percona-XtraDB-Cluster-shared-57-5.7.14-26.17.1.el7.x86_64 conflicts Percona-Server-shared-56
--> Processing Conflict: Percona-Server-shared-55-5.5.53-rel38.4.el7.x86_64 conflicts Percona-Server-shared-56
--> Finished Dependency Resolution
Error: Percona-Server-shared-55 conflicts with Percona-Server-shared-56-5.6.33-rel79.0.el7.x86_64
Error: Percona-XtraDB-Cluster-shared-55 conflicts with 1:Percona-XtraDB-Cluster-shared-56-5.6.32-25.17.1.el7.x86_64
Error: Percona-Server-shared-compat-57 conflicts with Percona-Server-shared-56-5.6.33-rel79.0.el7.x86_64
Error: Percona-XtraDB-Cluster-shared-57 conflicts with Percona-Server-shared-56-5.6.33-rel79.0.el7.x86_64
Error: Percona-XtraDB-Cluster-shared-compat-57 conflicts with 1:Percona-XtraDB-Cluster-shared-56-5.6.32-25.17.1.el7.x86_64
Error: Percona-Server-shared-compat-57 conflicts with Percona-Server-shared-55-5.5.53-rel38.4.el7.x86_64
Error: Percona-XtraDB-Cluster-shared-56 conflicts with Percona-Server-shared-56-5.6.33-rel79.0.el7.x86_64
Error: Percona-XtraDB-Cluster-shared-55 conflicts with Percona-Server-shared-55-5.5.53-rel38.4.el7.x86_64
Error: Percona-Server-shared-56 conflicts with Percona-Server-shared-55-5.5.53-rel38.4.el7.x86_64
Error: Percona-XtraDB-Cluster-shared-compat-57 conflicts with 1:Percona-XtraDB-Cluster-shared-55-5.5.41-25.12.855.el7.x86_64
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

具体导致的原因和解决方法没有找到比较好的,目前的处理方式是删除源:

rm /etc/yum.repos.d/percona-release.repo

方案二:下载二进制文件安装(推荐)

到页面https://www.percona.com/downloads/Percona-Server-5.7/LATEST/ 选择对应的版本进行下载。

安装方法:

rpm -ivh rpm文件

Download All Packages Together
Percona-Server-5.7.15-9-r9f0fd0a-el7-x86_64-bundle.tar 166.0 MB
Download Packages Separately
Percona-Server-57-debuginfo-5.7.15-9.1.el7.x86_64.rpm 89.9 MB
Percona-Server-client-57-5.7.15-9.1.el7.x86_64.rpm 7.1 MB
Percona-Server-devel-57-5.7.15-9.1.el7.x86_64.rpm 1.1 MB
Percona-Server-server-57-5.7.15-9.1.el7.x86_64.rpm 37.5 MB
Percona-Server-shared-57-5.7.15-9.1.el7.x86_64.rpm 747 KB
Percona-Server-shared-compat-57-5.7.15-9.1.el7.x86_64.rpm 1.2 MB
Percona-Server-test-57-5.7.15-9.1.el7.x86_64.rpm 26.9 MB
Percona-Server-tokudb-57-5.7.15-9.1.el7.x86_64.rpm 1.5 MB

推荐安装:

  • Percona-Server-server-57-5.7.15-9.1.el7.x86_64.rpm
  • Percona-Server-client-57-5.7.15-9.1.el7.x86_64.rpm
  • Percona-Server-tokudb-57-5.7.15-9.1.el7.x86_64.rpm

更多补充,尽请期待。



网友评论已有0条评论, 我也要评论

发表评论

*

* (保密)

Ctrl+Enter 快捷回复