Mysql数据库 出现故障之后 备份数据之~(冷备方法)

本文介绍了当CentOS7上的MySQL数据库出现故障时,如何通过冷备份方法在另一台服务器上恢复数据。步骤包括在故障服务器A上创建并填充数据,打包数据库文件,然后使用SSH将文件传输到备份服务器B,解压并调整权限,修改MySQL配置,最后重启数据库完成恢复。
摘要由CSDN通过智能技术生成

假设: centos服务器AB两台,A上的生产MySQL出现故障不能启动,但是数据文件是完好无损的。现在需要在B服务器上恢复数据库。

开始模拟

准备两台centos7虚拟机

192.168.27.136 A
192.168.27.136 B
在这里插入图片描述

安装mysql数据库

[root@localhost ~]# yum -y install mariadb mariadb-server

A上操作

1. 启动数据库 创建库表并插入数据(写点数据)

[root@localhost ~]# systemctl start mariadb
[root@localhost ~]# mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 2
Server version: 5.5.65-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> create database www character set utf8 collate utf8_bin;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]
  • 3
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值