本文链接:https://www.jianshu.com/p/c447c818f45f
环境:
- 操作系统:阿里云服务器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.修改密码
- 1 这个版本的mysql默认没有密码
mysql 可直接登录进去
- 2 配置访问密码,用户名root,密码root ,忽略警告
mysqladmin -u root password "root"
- 3 验证mysql命令是否有效
mysql -u root -p
7.开放3306端口
如果是云服务器,需要配置安全组,这里以阿里云服务器为例
-
1 如图,配置好后重启云服务器