SQL dump command to export MySQL database
Run this command to export a MySQL database into a SQL file:
mysqldump -u db_user -psecretpassword db_name > file_name.sql
If you don’t want to show password as plain text, omit it in the dump command:
mysqldump -u db_user -p db_name > file_name.sql
MySQL will then prompt for password when you execute the command.
In TablePlus, you can perform export database via the Backup feature.
- From the welcome screen, click on the Backup button
- If you are connected to the database already, navigate to menu File > Backup…
- Select database connection and schema to export
- Name your export file
-
Add export option if needed, including:
- –add-drop-database
- –lock-tables=false
- –all-databases
- –no-data
- –routines
- –add-drop-table
- –single-transaction
- –compress
- Start Backup.
TablePlus will prompt for the file location and then execute the mysqldump command with the options added.
Need a good GUI tool for databases? TablePlus provides a native client that allows you to access and manage Oracle, MySQL, SQL Server, PostgreSQL, and many other databases simultaneously using an intuitive and powerful graphical interface.
Not on Mac? Download TablePlus for Windows.
On Linux? Download TablePlus for Linux
Need a quick edit on the go? Download TablePlus for iOS