ubuntu20 mysql5.7 rds 文件恢复
恢复工具安装
wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb
sudo dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb
sudo apt install curl
sudo apt update
sudo apt install curl
sudo apt --fix-broken install
sudo apt search percona-xtrabackup
sudo apt install percona-xtrabackup-24
sudo tar -izxvf Desktop/111111111.tar.gz -C /opt/data/
chmod -R 777 /opt/data/
innobackupex --defaults-file=/opt/data/backup-my.cnf --apply-log /opt/data
sudo innobackupex --defaults-file=/opt/data/backup-my.cnf --apply-log /opt/data
mysqld_safe --datadir=/opt/data --defaults-file=/opt/data/backup-my.cnf
下载mysql 5.7
wget https://downloads.mysql.com/archives/get/p/23/file/mysql-server_5.7.31-1ubuntu18.04_amd64.deb-bundle.tar
tar xvf mysql-server_5.7.31-1ubuntu18.04_amd64.deb-bundle.tar
sudo apt-get install ./libmysql*
sudo apt install ./mysql-client_5.7.31-1ubuntu18.04_amd64.deb
sudo apt install ./mysql-server_5.7.31-1ubuntu18.04_amd64.deb
sudo apt install ./mysql-community-server_5.7.31-1ubuntu18.04_amd64.deb
mysql 重置密码
mysqld 配置文件中加入 skip_grant_tables 保存后退出
重启mysql
alert
异常修复
Can’t create test file .lowe-test
setenforce 0
# /etc/apparmor.d/usr.sbin.mysqld
# 在 /var/lib/mysql/ r,
# /var/lib/mysql/** rwk,
# 下加入
/opt/data/ r,
/opt/data/** rwk,
/etc/inid.d/apparmor restart
引用
- https://www.percona.com/doc/percona-xtrabackup/2.4/installation/apt_repo.html
- https://blog.csdn.net/weixin_43277401/article/details/89951366
- https://help.aliyun.com/knowledge_detail/41817.html?spm=a2c4g.11186631.2.1.434247acfAIAwY
- https://blog.csdn.net/weixin_38640195/article/details/107431635
- https://www.cnblogs.com/pangchunyu/p/11422830.html