Select Page

How to export a MySql database to a file via the Command Line in Linux

  • Open a new Terminal Window
  • Type in the following command
    {codecitation class=”brush: bash;”}
    mysqldump -uUsername -pPassword DatabaseName > outputFile.sql
  • The command above will export a selected database to a file called outputFile.sql
    • mysqldump = a database backup program
    • -u = Username for the database
    • -p Password for the database
    • DatabaseName The database name you wish to export

Last Updated On March 23, 2018

Leave a reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.