Can PhpStorm dump a MySQL database into a sql file?

18,341

Solution 1

As far as I know, you can export data from tables. Some types of database allows you to Copy DDL of any node.

More at

Solution 2

As of this writing (2018.1), right clicking on a database gives you the option to "Dump with 'mysqldump'".

Solution 3

No, in phpstorm there is no such option.

You only can export single Tables from the Database by clicking on ONE single Table (doesn't work if you mark more than one Table) and open Mouse-Menu (right mouseclick). There you choose "Save to File..." an Choose what you need (for example " SQL Insert Statements".

For having a good DB-Client to manage the whole Stuff, use DBeaver (Standalone Version), or MysqlWorkbench. I preffer DBeaver.

Solution 4

In the latest editions you can right click on a Database and dump to file. It exports to individual files per table.

Share:
18,341

Related videos on Youtube

Sebas Zella
Author by

Sebas Zella

Updated on July 08, 2021

Comments

  • Sebas Zella
    Sebas Zella over 1 year

    I know PhpStorm can connect to a database and work with it. Is it possible to export the database to a myDb.sql file with phpstorm?

  • LazyOne
    LazyOne almost 9 years
    You can easily see table/index definitions as well (Copy DDL action).
  • Michal Brašna almost 9 years
    @LazyOne True enough, updated the answer, I usually use it with SQLite and there is no such option.
  • Joshua Wooward over 5 years
    FYI, you can right click on the database and dump to file. still individual export files, but dont have to select one by one.
  • suther
    suther over 5 years
    @jwoodward : You are right, current Versions have this now.
  • Steen Schütt
    Steen Schütt over 3 years
    And this will dump everything to a single file, which makes everything much easier. Thanks!
  • Daniyal Nasir
    Daniyal Nasir over 1 year
    I tried it but for some reason it asked for me mysql user password (I don't have any password for my local environment) upon submitting with empty field nothing happens.

Related