yum安装mysql-5.6(centos7)-阿里云备份恢复到本地

centos 7.3 安装mysql 5.6

rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
yum repolist enabled | grep "mysql.*-community.*" (查看当前可用的mysql安装资源)
yum -y install mysql-community-server
systemctl start mysqld

安装阿里云的备份文件恢复工具:

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

其他操作:

调整本地的磁盘:/ 分区110g的大小
systemctl stop mysqld

下载阿里云的全北实例:
tar  fx xxx.tar.gz
mv /var/lib/mysql/* /opt
cp -rp ./* /var/lib/mysql/

innobackupex --defaults-file=/var/lib/mysql/backup-my.cnf --apply-log /var/lib//mysql
......
InnoDB: Starting shutdown...
InnoDB: Shutdown completed; log sequence number 1552626957387
190320 17:26:02 completed OK!    --------->代表恢复成功

chown -R mysql. /var/lib/mysql
systemctl start  mysql

此时就可以利用登录账号登录了。

 


 

 

posted @ 2019-03-19 15:26  开始认识  阅读(419)  评论(0编辑  收藏  举报