Comments (15)
from ibd2sql.
3、使用ibd2sql解析数据 $ python3.6 main.py /data0/mysqlsandbox/data/sandboxes/msb_8_0_33/data/testdb/dts_test_table.ibd --sql > /data0/dts_test_table.sql
- ibd2sql是否为最新版呢 ? (我好像处理过类似的问题).
- 提供下DDL和测试数据, 我复现下. 非图片版的(我懒得敲-_-)
- 也可以提供下 --debug 的日志
from ibd2sql.
1、代码是直接clone的main分支的代码。
2、测试数据不好提供,因为我使用相同的表结构、插入了一条数据,然后再使用ibd2sql 导出data是没有任何问题的,您留一个邮箱,我把ibd文件发给你,这个表是纯测试数据,没有我们自己的数据。
3、debug日志:
debug.zip
from ibd2sql.
已发送邮箱
from ibd2sql.
已发送邮箱
收到. 我看下先.
from ibd2sql.
用ibd2sql 0.3 版本可以解析, 看来是新版本引入的BUG . 我尽快修改 1.0 的这个BUG
已发送邮箱
from ibd2sql.
好的 修复了以后麻烦update一下这个issuse,我再测一下
from ibd2sql.
好的 修复了以后麻烦update一下这个issuse,我再测一下
修复了, 你重新下载后, 再试下呢
修复记录:
# ibd2sql/innodb_page_index.py::record_header
self.instant = True
from ibd2sql.
python3.6 main.py /data0/dts_test_table.ibd --sql > /data0/dts_test_table.sql
Traceback (most recent call last):
File "main.py", line 5, in
from ibd2sql.ibd2sql import ibd2sql
File "/root/ibd2sql-main/ibd2sql/ibd2sql.py", line 7, in
from ibd2sql.innodb_page_index import *
File "/root/ibd2sql-main/ibd2sql/innodb_page_index.py", line 53
self.instant = True
^
TabError: inconsistent use of tabs and spaces in indentation
from ibd2sql.
python3.6 main.py /data0/dts_test_table.ibd --sql > /data0/dts_test_table.sql
Traceback (most recent call last): File "main.py", line 5, in from ibd2sql.ibd2sql import ibd2sql File "/root/ibd2sql-main/ibd2sql/ibd2sql.py", line 7, in from ibd2sql.innodb_page_index import * File "/root/ibd2sql-main/ibd2sql/innodb_page_index.py", line 53 self.instant = True ^ TabError: inconsistent use of tabs and spaces in indentation
你clone的还是自己修改的呢, 修改的话, 我代码里面是tab 不是空格
from ibd2sql.
Traceback (most recent call last):
File "main.py", line 177, in
ddcw.get_sql()
File "/root/ibd2sql-main/ibd2sql/ibd2sql.py", line 229, in get_sql
for x in _tdata:
File "/root/ibd2sql-main/ibd2sql/innodb_page_index.py", line 226, in read_row
self._read_all_row()
File "/root/ibd2sql-main/ibd2sql/innodb_page_index.py", line 396, in _read_all_row
_data[colno],_expage[colno] = self._read_field(col)
File "/root/ibd2sql-main/ibd2sql/innodb_page_index.py", line 162, in _read_field
data = self.read(size).decode()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 53: invalid start byte
from ibd2sql.
Traceback (most recent call last): File "main.py", line 177, in ddcw.get_sql() File "/root/ibd2sql-main/ibd2sql/ibd2sql.py", line 229, in get_sql for x in _tdata: File "/root/ibd2sql-main/ibd2sql/innodb_page_index.py", line 226, in read_row self._read_all_row() File "/root/ibd2sql-main/ibd2sql/innodb_page_index.py", line 396, in _read_all_row _data[colno],_expage[colno] = self._read_field(col) File "/root/ibd2sql-main/ibd2sql/innodb_page_index.py", line 162, in _read_field data = self.read(size).decode() UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 53: invalid start byte
已修复, 请重新下载最新版本试下呢,
我测试了下, 全部解析出来了. 3.3GB左右, 700W行左右数据 (可以看 /proc/PID/io 的rchar 来预估速度哈)
修复记录: recorde header 1-2bit is instant flag
from ibd2sql.
greate! 👍🏻
from ibd2sql.
https://cloud.tencent.com/developer/article/2407144?pos=comment
这个文章有一个地方有问题,就是推荐使用import tablespace的方式将ibd文件导入到现有数据库中
1、缺少 表名.cfg 文件
2、alter table xxx import tablespace的时候会报lsn错误
from ibd2sql.
- 因为不一定是flush export 出来的ibd文件, 所以不一定有.cfg文件. (无.cfg的话, 会有warning提示, 不影响导入): 官方教程: https://dev.mysql.com/doc/refman/8.0/en/innodb-troubleshooting-datadict.html
- 如果目标环境是新环境的话, 是可能存在lsn的问题. 而且ibd文件本身也可能存在问题. 这时候就可以使用ibd2sql来解析了.
--page-start 100 --page-count 1
解析指定的页
https://cloud.tencent.com/developer/article/2407144?pos=comment
这个文章有一个地方有问题,就是推荐使用import tablespace的方式将ibd文件导入到现有数据库中 1、缺少 表名.cfg 文件 2、alter table xxx import tablespace的时候会报lsn错误
from ibd2sql.
Related Issues (20)
- 能否可以支持自己指定表ddl创建语句 HOT 1
- 感激,分分钟解决问题 HOT 2
- 老铁可以支持导出功能吗,导出来txt或者.sql格式的文件呢,谢谢 HOT 1
- 老铁,不是我说你,遮遮掩掩的。 HOT 2
- 解析5.7 ibd文件失败,没有任何输出 HOT 4
- 执行命令的时候报错 row_format = compressed or its damaged or its mysql 5.7 file HOT 3
- --ddl 生成错的 `!hidden!_dropped_v1_p13_status` NULL, 这怎么解决 HOT 4
- 恢复数据时报错RecursionError: maximum recursion depth exceeded,网上找了解决方案后执行不报错,但数据有缺失 HOT 5
- 你好,没有看到任何数据,在8.0里面生成的ibd 库名也要对应吗,我是从5.7导出create语句,在8.0执行的 HOT 7
- first_blob 方法 解包异常 HOT 12
- 你好,mysql8.0 数据恢复有问题 HOT 4
- 说几个使用体验吧 HOT 1
- 转换的时候乱码了 HOT 4
- noob_loop HOT 1
- 一坨大便
- zlib.error: Error -3 while decompressing data: unknown compression method HOT 1
- 对于 mysqlfrm 解析 mysql 5.* 不准确的问题 可以使用 dbsake 工具进行解析 HOT 1
- 使用 5.6.16提取 sql 时 死循环了 HOT 5
- 是否支持undrop for innodb 磁盘扫描出来的ibd碎片解析? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ibd2sql.