CentOS7 下 MySQL 5.7.23 & XtraBackup 24 做数据备份(1)——安装软件
在两台机子上同时操作下面的步骤
首先安装MySQL,从官网下载相对应版本的RPM包
- mysql-community-client-5.7.23-1.el7.x86_64.rpm
- mysql-community-common-5.7.23-1.el7.x86_64.rpm
- mysql-community-libs-5.7.23-1.el7.x86_64.rpm
- mysql-community-libs-compat-5.7.23-1.el7.x86_64.rpm (*解决与XtraBackup安装时,my.cnf冲突问题)
- mysql-community-server-5.7.23-1.el7.x86_64.rpm
一口气把他们全都安上,省的报依赖错误
rpm -ivh mysql-community-client-5.7.23-1.el7.x86_64.rpm mysql-community-common-5.7.23-1.el7.x86_64.rpm mysql-community-libs-5.7.23-1.el7.x86_64.rpm mysql-community-libs-compat-5.7.23-1.el7.x86_64.rpm mysql-community-server-5.7.23-1.el7.x86_64.rpm
初始化MySQL
先修改 /var/lib/mysql/ 文件夹的权限,因为是用root权限安装的,需要修改为mysql的权限。
chown -R mysql.mysql /var/lib/mysql/
初始化MySQL
mysqld --initialize
从mysqld.log中获取初始密码,得到红色部分的密码
[root@localhost srv]# cat /var/log/mysqld.log | grep 'y password'
2018-08-23T05:54:39.866279Z 1 [Note] A temporary password is generated for root@localhost: (WRwAWtoj14+
登录mysql,修改密码
[root@localhost srv]# mysql -uroot -p'(WRwAWtoj14+'
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.23 Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> alter user root@localhost identified by 'root';
Query OK, 0 rows affected (0.01 sec) mysql> exit
Bye
至此,MySQL安装完毕
安装XtraBackup
按照官网的安装示例安装即可:https://www.percona.com/doc/percona-xtrabackup/2.4/installation/yum_repo.html
1、安装Percona yum 仓库
yum install http://www.percona.com/downloads/percona-release/redhat/0.1-6/percona-release-0.1-6.noarch.rpm
2、安装XtraBackup 24
yum install percona-xtrabackup-24 -y
会以依赖安装(就是因为依赖总是离线安不上,才用的yum):
作为依赖被安装:
libev.x86_64 0:4.15-7.el7 perl-DBD-MySQL.x86_64 0:4.023-6.el7 perl-Digest.noarch 0:1.17-245.el7
perl-Digest-MD5.x86_64 0:2.52-3.el7 rsync.x86_64 0:3.1.2-4.el7
至此,两个软件安装完毕
上面安装中的一些坑(已经帮助跳过去了):
1、MySQL无法启动,cli下报如下错误
[root@localhost srv]# service mysqld start
Redirecting to /bin/systemctl start mysqld.service
Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details.
/var/log/mysqld.log中报如下错误
2018-08-23T06:08:24.018182Z 0 [ERROR] InnoDB: The innodb_system data file 'ibdata1' must be writable
2018-08-23T06:08:24.018188Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2018-08-23T06:08:24.620670Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2018-08-23T06:08:24.620698Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2018-08-23T06:08:24.620703Z 0 [ERROR] Failed to initialize builtin plugins.
2018-08-23T06:08:24.620706Z 0 [ERROR] Aborting
解决方法看上面的MySQL初始化部分
2、XtraBackup安装冲突
file /etc/my.cnf from install of Percona-Server-shared-56-5.6.41-rel84.1.el7.x86_64 conflicts with file from package mysql-community-server-5.7.23-1.el7.x86_64
先安装 mysql-community-libs-compat-5.7.23-1.el7.x86_64.rpm 即可
CentOS7 下 MySQL 5.7.23 & XtraBackup 24 做数据备份(1)——安装软件的更多相关文章
- Centos7 下mysql大小写敏感问题
在Centos7 下mysql大小写敏感问题,会导致程序运行时找不到对应的表. 解决办法: 第一步:编辑/etc/my.cnf文件,在[mysqld]节下 添加 lower_case_table_na ...
- Linux - centos7 下 MySQL(mariadb) 和 主从复制
目录 Linux - centos7 下 MySQL(mariadb) 和 主从复制 MySQL(mariadb) 安装MySQL(mariadb) 配置数据库的中文支持 在远程用 mysql客户端去 ...
- Centos7 下mysql 密码重置
Centos7 下mysql 密码重置 先停止mysql服务 mysqld_safe --skip-grant-tables & mysql mysql> use mysql;mysql ...
- 【mysql】centos7下mysql的安装以及基本操作
centos7使用的MariaDB,替代了早期版本默认的MySQL.MariaDB是MySQL的一个分支,由开源社区维护,采用GPL授权许可,且MariaDB完全贱人MySQL. 检查centos7下 ...
- linux centos7下mysql安装--韩国庆
首先我先给大家介绍下MariaDB和mysql的区别. 上图,“MySQL之父”的骨灰级程序员Monty,但是mysql被Oracle收购后,Monty又开始去发展另一条数据库的道路,并且以Monty ...
- windows、ubuntu、centos7下mysql 的安装与使用
一.windows 及ubuntu下安装 windows可以傻瓜式安装,另一种空闲了下来写,也不麻烦 ubuntu: apt-get install mysql 强烈推荐使用ubuntu从这儿就很方便 ...
- docker 下mysql 和postgresql 数据库的搭建以及数据文件的迁移和备份
service docker start - docker 启动 service docker stop - docker 关闭 1.docker 镜像创建—使用的默认镜像有数据卷 docker pu ...
- CentOS7下Mysql 5.6.30安装与配置
环境:centos 7 x64 先下载mysql安装包 打开 http://dev.mysql.com/downloads/mysql/ 选择 linux - Generic 再选择 下载完毕后,得 ...
- centos7下mysql双主+keepalived
一.keepalived简介 keepalived是vrrp协议的实现,原生设计目的是为了高可用ipvs服务,keepalived能够配置文件中的定义生成ipvs规则,并能够对各RS的健康状态进行检测 ...
随机推荐
- Happy 2006 POJ - 2773 容斥原理+二分
题意: 找到第k个与m互质的数 题解: 容斥原理求区间(1到r)里面跟n互质的个数时间复杂度O(sqrt(n))- 二分复杂度也是O(log(n)) 容斥原理+二分这个r 代码: 1 #include ...
- B - 来找一找吧 HihoCoder - 1701
题目: 这次到渣渣问桶桶了... 准备给你n个数a1, a2, ... an,桶桶你能从中找出m个特别的整数吗,我想让任意两个之差都是k的倍数. 请你计算有多少种不同的选法.由于选法可能非常多,你只需 ...
- poj2362 Square
Description Given a set of sticks of various lengths, is it possible to join them end-to-end to form ...
- Balanced Numbers SPOJ - BALNUM
代码+注释 1 //我感觉这道题最扯的就是我因为输入而TLE了半天,懵逼死了,想破脑袋也没想到因为输入TLE了半天 2 //题意:求区间内数字满足"奇数各数出现偶数次,偶数各数出现奇数次&q ...
- ASP.Net Core 5.0 MVC中AOP思想的体现(五种过滤器)并结合项目案例说明过滤器的用法
执行顺序 使用方法,首先实现各自的接口,override里面的方法, 然后在startup 类的 ConfigureServices 方法,注册它们. 下面我将代码贴出来,照着模仿就可以了 IActi ...
- Zabbix 触发器配置多监控项阈值
配置内存自定义监控项 # 监控内存命令 [root@web01 ~]# free -m|awk '/^Mem/{print $NF/$2}' 0.664609 [root@web01 ~]# free ...
- 缓冲区溢出实验 5 Snprintf
实验环境.代码.及准备 https://www.cnblogs.com/lqerio/p/12870834.html vul5 Snprintf函数,百度百科: 将可变个参数(...)按照format ...
- mysql 索引类型以及创建
明天就去面浦发了,感觉对数据库有些忘了,时间紧迫,就直接把链接贴这了,有空再整理. 参考: 1. https://www.cnblogs.com/crazylqy/p/7615388.html
- 使用 js 实现十大排序算法: 归并排序
使用 js 实现十大排序算法: 归并排序 归并排序 refs js 十大排序算法 All In One https://www.cnblogs.com/xgqfrms/p/13947122.html ...
- GitHub in depth
GitHub in depth GitHub 高级玩法 / 进阶教程 https://github.com/trending/dart?since=daily https://github.com/t ...