排障集锦:九九八十一难之第九难!mysql备份恢复路上的小插曲
时间:2022-07-24
本文章向大家介绍排障集锦:九九八十一难之第九难!mysql备份恢复路上的小插曲,主要内容包括其使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。
问题描述一 断点恢复ERROR 1146 (42S02) at line 35: Table ‘shang.info’ doesn’t exist
[root@localhost opt]# mysqlbinlog --no-defaults --stop-datetime='2020-08-23 13:29:04' /usr/local/mysql/data/mysql-bin.000002 | mysql -uroot -p
Enter password:
ERROR 1146 (42S02) at line 35: Table 'shang.info' doesn't exist
解决思路
断点恢复之前进行完全备份
mysql> source /opt/shang.sql;
问题描述二、 完全备份后无法进行数据恢复
ERROR 1146 (42S02): Table ‘shang.shang’ doesn’t exist
[root@localhost opt]# mysql -uroot -pAbc123
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 12
Server version: 5.7.17-log Source distribution
Copyright (c) 2000, 2016, 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> source /opt/shang.sql; '进行数据恢复'
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.01 sec)
Query OK, 0 rows affected (0.00 sec)
mysql> select * from shang; '一直报错'
ERROR 1146 (42S02): Table 'shang.shang' doesn't exist
解决方案
1、查看备份.sql 具体如下
-- Table structure for table `info`
--
DROP TABLE IF EXISTS `info`; '首先判断info表是否存在,如果存在的话才能接一下操作'
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `info` (
`id` int(11) NOT NULL,
`name` char(4) NOT NULL,
`score` decimal(5,2) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
2、定位问题
回到数据库中 进入到绝对路径具体的库中 进行重新恢复
mysql> use shang;
Database changed
mysql> source /opt/shang.sql;
Query OK, 0 rows affected (0.01 sec)
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
mysql> select * from info;
+----+------+-------+
| id | name | score |
+----+------+-------+
| 1 | zhen | 99.00 |
| 2 | qqqq | 88.00 |
| 3 | wwww | 77.00 |
+----+------+-------+
3 rows in set (0.00 sec)
- “一切都是消息”--MSF(消息服务框架)之【发布-订阅】模式
- Android基础总结(4)——广播接收器
- “一切都是消息”--MSF(消息服务框架)之【请求-响应】模式(点对点)
- “老坛泡新菜”:SOD MVVM框架,让WinForms焕发新春
- 解决服务器SID引起虚拟机不能加入AD域用户,无法远程登录的问题
- 【Python环境】如何使用 Docker 快速配置数据科学开发环境?
- Java中UUID的2种创建方法——有代码实例
- 使用“消息服务框架”(MSF)实现分布式事务的三阶段提交协议(电商创建订单的示例)
- Android基础总结(3)——UI界面布局
- 常见.NET功能代码汇总 (2)
- 问题系列之Java中删除有序List的重复数据——提供两种方法
- 二叉树的基本概念和遍历
- Java中MD5加密算法实现方法——附上具体代码
- 新手,Visual Studio 2015 配置Boost库,如何编译和选择,遇到无法打开文件“libboost_thread-vc140-mt-gd-1_63.lib“的解决办法
- MySQL 教程
- MySQL 安装
- MySQL 管理与配置
- MySQL PHP 语法
- MySQL 连接
- MySQL 创建数据库
- MySQL 删除数据库
- MySQL 选择数据库
- MySQL 数据类型
- MySQL 创建数据表
- MySQL 删除数据表
- MySQL 插入数据
- MySQL 查询数据
- MySQL where 子句
- MySQL UPDATE 查询
- MySQL DELETE 语句
- MySQL LIKE 子句
- mysql order by
- Mysql Join的使用
- MySQL NULL 值处理
- MySQL 正则表达式
- MySQL 事务
- MySQL ALTER命令
- MySQL 索引
- MySQL 临时表
- MySQL 复制表
- 查看MySQL 元数据
- MySQL 序列 AUTO_INCREMENT
- MySQL 处理重复数据
- MySQL 及 SQL 注入
- MySQL 导出数据
- MySQL 导入数据
- MYSQL 函数大全
- MySQL Group By 实例讲解
- MySQL Max()函数实例讲解
- mysql count函数实例
- MYSQL UNION和UNION ALL实例
- MySQL IN 用法
- MySQL between and 实例讲解