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

H

How Can We Help?

  • Open a new Terminal Window
  • Type in the following command
    {codecitation class=”brush: bash;”}
    mysqldump -uUsername -pPassword DatabaseName > outputFile.sql
    {/codecitation}
  • 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

About the author

Ian Carnaghan

I am a software developer and online educator who likes to keep up with all the latest in technology. I also manage cloud infrastructure, continuous monitoring, DevOps processes, security, and continuous integration and deployment.

About Author

Ian Carnaghan

I am a software developer and online educator who likes to keep up with all the latest in technology. I also manage cloud infrastructure, continuous monitoring, DevOps processes, security, and continuous integration and deployment.

Follow Me