简体   繁体   English

将 mysql 转储中的数据导入 MySql Workbench

[英]Import data from mysql dump into MySql Workbench

I have an old MySql dump file (xyz.sql) that I want to import to a model in MySql Workbench.我有一个旧的 MySql 转储文件 (xyz.sql),我想将它导入到 MySql Workbench 中的模型中。

I was able to do a Reverse Engineering of the file which created the schema and all the tables.我能够对创建架构和所有表的文件进行逆向工程。 Unfortunately it didn't import the data which is important.不幸的是,它没有导入重要的数据。

So all tables are empty under the "Inserts" tab.因此,“插入”选项卡下的所有表都是空的。

How can I import the data from the file into the tables or import the complete file schema + data in 1 step.如何将文件中的数据导入表或在 1 步中导入完整的文件架构 + 数据。

I use MySql Workbench 8.0.27我使用 MySql Workbench 8.0.27

Thanks谢谢

From https://findanyanswer.com/how-do-i-import-a-sql-file-into-mysql-workbench来自https://findanyanswer.com/how-do-i-import-a-sql-file-into-mysql-workbench

  1. Click Data Import / Restore.单击数据导入/恢复。
  2. Select Import from Self-Contained File.选择从独立文件导入。
  3. Click … and locate your .sql file.单击 ... 并找到您的 .sql 文件。
  4. Under Default Target Schema select the database where you want this import to go.在 Default Target Schema 下,选择要导入的数据库。
  5. Click Start Import.单击开始导入。

or或者

Import data into table using mysql -u username -p databasename < path/example.sql使用mysql -u username -p databasename < path/example.sql将数据导入表

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM