Can PhpStorm dump a MySQL database into a sql file?
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
- http://blog.jetbrains.com/phpstorm/2013/10/database-tools-and-sql-editor-changes-in-phpstorm-7/ section Exporting Data
- http://www.jetbrains.com/phpstorm/webhelp/database-tool-window.html
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.
Related videos on Youtube

Sebas Zella
Updated on July 08, 2021Comments
-
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 almost 9 yearsYou 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 yearsFYI, you can right click on the database and dump to file. still individual export files, but dont have to select one by one.
-
suther over 5 years@jwoodward : You are right, current Versions have this now.
-
Steen Schütt over 3 yearsAnd this will dump everything to a single file, which makes everything much easier. Thanks!
-
Daniyal Nasir over 1 yearI 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.