目 录CONTENT

文章目录

Centos 7下安装Percona-Server

在水一方
2022-01-05 / 0 评论 / 0 点赞 / 572 阅读 / 2,255 字 / 正在检测是否收录...

在docker等容器化技术还没有普及的时候,Linux中安装mysql是一个非常麻烦的事情,本文主要记录Percona-Server(mysql)的安装过程,后续遇到安装mysql的情况为防止遗忘找不到,现做一个记录

环境:
操作系统:阿里云服务器Centos 7
软件版本:Percona-Server-5.6.41

注意:安装之前请检查机器中是否已经存在mysql,如果存在,则安装会冲突出错,彻底删除mysql链接:https://www.jianshu.com/p/8130ba0f25bb

1.下载软件之后上传到服务器,可通过xftp或者其他工具

软件链接: https://pan.baidu.com/s/1HNMXorpy2K0at5_QA7a-zw 提取码: 868w

2.解压压缩包到指定文件夹,可随意指定

tar -xvf Percona-Server-5.6.41-84.1-rb308619-el7-x86_64-bundle.tar -C /home/software/mysql/

3.卸载废弃的依赖包

yum remove mariadb*

4.进入到解压目录进行rpm安装,注意顺序不能乱

cd /home/software/mysql
rpm -ivh Percona-Server-56-debuginfo-5.6.41-rel84.1.el7.x86_64.rpm
rpm -ivh Percona-Server-shared-56-5.6.41-rel84.1.el7.x86_64.rpm
rpm -ivh Percona-Server-client-56-5.6.41-rel84.1.el7.x86_64.rpm
rpm -ivh Percona-Server-server-56-5.6.41-rel84.1.el7.x86_64.rpm

注意问题:如果出现以下错误:

问题一:
error: Failed dependencies:
/usr/bin/perl is needed by Percona-Server-client-56-5.6.41-rel84.1.el7.x86_64

解决:yum install perl

问题二:
error: Failed dependencies:
libaio.so.1()(64bit) is needed by Percona-Server-server-56-5.6.41-rel84.1.el7.x86_64
libaio.so.1(LIBAIO_0.1)(64bit) is needed by Percona-Server-server-56-5.6.41-rel84.1.el7.x86_64
libaio.so.1(LIBAIO_0.4)(64bit) is needed by Percona-Server-server-56-5.6.41-rel84.1.el7.x86_64
perl(Data::Dumper) is needed by Percona-Server-server-56-5.6.41-rel84.1.el7.x86_64

解决:缺少依赖libaio包,下载http://mirror.centos.org/centos/6/os/x86_64/Packages/libaio-0.3.107-10.el6.x86_64.rpm

然后 rpm -ivh libaio-0.3.107-10.el6.x86_64.rpm

问题三:
error: Failed dependencies:
perl(Data::Dumper) is needed by Percona-Server-server-56-5.6.41-rel84.1.el7.x86_64

解决办法: yum install autoconf

问题四:
error: Failed dependencies:
libnuma.so.1()(64bit) is needed by Percona-Server-server-56-5.6.41-rel84.1.el7.x86_64
libnuma.so.1(libnuma_1.1)(64bit) is needed by Percona-Server-server-56-5.6.41-rel84.1.el7.x86_64
libnuma.so.1(libnuma_1.2)(64bit) is needed by Percona-Server-server-56-5.6.41-rel84.1.el7.x86_64
解决:yum install numactl

5.启动MySQL服务

service mysql start 启动服务
service mysql status 查看服务状态
service mysql stop 停止服务
service mysql restart 重启服务

6.修改密码

  • 这个版本的mysql默认没有密码
  • mysql 可直接登录进去
    配置访问密码,用户名root,密码root ,忽略警告

mysqladmin -u root password "root"

  • 验证mysql命令是否有效

mysql -u root -p

7.开放3306端口

登录阿里云账号,在ECS的安全组中开放3306端口

8.开放防火墙

参考链接:https://www.jianshu.com/p/dd1366cf57f3

9.允许远程访问root用户

参考链接:https://www.jianshu.com/p/7b5a647bab57

参考转自:https://www.jianshu.com/p/c447c818f45f

0

评论区