Giter VIP home page Giter VIP logo

Comments (7)

ddcw avatar ddcw commented on August 31, 2024

我在解析数据的时候,发现datetime类型和int类型的数据解析有问题。会成-3954-2-26 3:20:54、-1257699829类似的这种格式。请问这个要怎么修复呀

看起来像是符号问题,

  1. ibd2sql版本是哪个呢?
  2. mysql版本是哪个呢?
  3. 是否做过DDL操作?
  4. 可否提供下相关测试数据呢, DDL加能复现的数据即可

from ibd2sql.

monkey-hjy avatar monkey-hjy commented on August 31, 2024

感谢。
1、ibd2sql是最新的,刚从git上clone下来的
2、mysql是8.0.36
3、生成ddl没问题的,格式正确。
4、ddl如下:
CREATE TABLE wh_web.user(
id int NOT NULL AUTO_INCREMENT,
user_name varchar(100) NULL,
pwd varchar(100) NULL,
last_login_time datetime NULL,
token varchar(100) NULL,
insert_time datetime DEFAULT (CURRENT_TIMESTAMP),
is_root int NULL DEFAULT '0',
is_delete int NULL DEFAULT '0',
author_name varchar(100) NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci ;

生成的一条数据如下:
INSERT INTO wh_web.user(id,user_name,pwd,last_login_time,token,insert_time,is_root,is_delete,author_name) VALUES (1, NULL, '180377111111', '-3796-4-24 25:38:49', '', '7935-7-23 30:26:21', 753249927, -2029647092, NULL);

from ibd2sql.

ddcw avatar ddcw commented on August 31, 2024

感谢。 1、ibd2sql是最新的,刚从git上clone下来的 2、mysql是8.0.36 3、生成ddl没问题的,格式正确。 4、ddl如下: CREATE TABLE wh_web.user( id int NOT NULL AUTO_INCREMENT, user_name varchar(100) NULL, pwd varchar(100) NULL, last_login_time datetime NULL, token varchar(100) NULL, insert_time datetime DEFAULT (CURRENT_TIMESTAMP), is_root int NULL DEFAULT '0', is_delete int NULL DEFAULT '0', author_name varchar(100) NULL, PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci ;

生成的一条数据如下: INSERT INTO wh_web.user(id,user_name,pwd,last_login_time,token,insert_time,is_root,is_delete,author_name) VALUES (1, NULL, '180377111111', '-3796-4-24 25:38:49', '', '7935-7-23 30:26:21', 753249927, -2029647092, NULL);

表结构是正常的. 我模拟了测试数据,是能够正常解析的.
能否提供下 原始的数据呢, 有问题的那几条就行. (解析出来的那条数据是不对的,不能复现)

from ibd2sql.

monkey-hjy avatar monkey-hjy commented on August 31, 2024

我可以加个你联系方式吗?直接把ibd发你。原始数据没了,只有这个ibd文件了

from ibd2sql.

monkey-hjy avatar monkey-hjy commented on August 31, 2024

或者你的邮箱可以吗?ibd文件里有一些数据不方便发在这里

from ibd2sql.

ddcw avatar ddcw commented on August 31, 2024

不要直接发ibd文件, 也不要发未脱敏的数据. 不安全.

  1. 如果只是部分数据有问题的话, 可以选择跳过那部分数据 --page-start & --page-count
  2. 可以使用 v0.3 版本的ibd2sql试下
  3. 如果ibd文件未损坏的话, 可以直接使用mysql恢复的. 步骤参考
-- 相同版本的数据库创建相同的库表
use xxxx;
create table t20240409(id int, aa varchar(200)); -- 建表
alter table t20240409 discard tablespace; -- 删除原表空间
-- cp -ra xxxx.ibd  @@datadir/dbname/xxxx.ibd  拷贝你要恢复的数据的那个ibd文件过来
alter table t20240409 import tablespace; -- 导入表空间
show warnings; -- 如果有告警, 建议看一下
select * from t20240409; -- 验证数据

这个ibd2sql更偏向于ibd文件顺坏了的情况来恢复数据的. 建议优先使用mysql来恢复数据.

或者你的邮箱可以吗?ibd文件里有一些数据不方便发在这里

from ibd2sql.

monkey-hjy avatar monkey-hjy commented on August 31, 2024

1、目前看所有数据都有问题。
2、我试一下0.3的版本
3、mysql恢复我试过了,到import tablespace这一步就会一直失败,提示某个字段的类型对不上。
我再试一下,多谢多谢。

from ibd2sql.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.