MySQL 如何在一个 SQL 文件中从 DataGrip 导出数据库?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/38962507/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 21:58:08  来源:igfitidea点击:

How to export a data base from DataGrip at one SQL file?

mysqldatagrip

提问by Siricks

How I can export a data base from DataGrip at one SQL file as phpmyadmin export?

如何将 DataGrip 中的数据库导出到一个 SQL 文件中作为 phpmyadmin 导出?

If I use Dump Data To Files, DataGrip save one table at one file.

如果我使用 Dump Data To Files,DataGrip 会将一张表保存在一个文件中。

And how I can create backup of all MySQL databases, which open in DataGrip?

以及如何创建在 DataGrip 中打开的所有 MySQL 数据库的备份?

回答by Daniell

Old thread here, but for those who may stumble upon it, the newer versions of DataGrip have a new option, "dump with mysqldump", that will let you generate a dump contained in a single .sql output file.

旧线程在这里,但对于那些可能会偶然发现它的人来说,较新版本的 DataGrip 有一个新选项,“使用 mysqldump 转储”,它可以让您生成包含在单个 .sql 输出文件中的转储。

enter image description here

在此处输入图片说明

回答by ulrichenslin

Running DataGrip 2016.2.5 you can select sever tables and right click->Copy DDL. That puts a drop/create script on the clipboard, which you can then paste into a text file.

运行 DataGrip 2016.2.5 可以选择服务器表并右键单击->复制 DDL。这会在剪贴板上放置一个放置/创建脚本,然后您可以将其粘贴到文本文件中。

回答by groundh0g

I just got the DataGrip 2016.2.1 update this morning. It looks like the feature has been added (at least for SQL SERVER, the only one I tested). It wasn't available in the previous version - I tried.

我今天早上刚收到 DataGrip 2016.2.1 更新。看起来该功能已添加(至少对于 SQL SERVER,我测试的唯一一个)。它在以前的版本中不可用 - 我试过了。

Select a range of tables and right-click on them, or right-click on the database name. The Dump Data to Filesoption is now there.

选择一系列表并右键单击它们,或右键单击数据库名称。该Dump Data to Files选项是现在。

Unfortunately, it still dumps to multiple files. But it beats the heck out of right-clicking on each table in turn.

不幸的是,它仍然转储到多个文件。但它击败了依次右键单击每个表。

回答by Kirill

You can now tick "Single File" while choosing "Dump Data to File(s)" in DataGrip 2018.3.1enter image description here

您现在可以在 DataGrip 2018.3.1 中选择“Dump Data to File(s)”时勾选“Single File”在此处输入图片说明