How to backup a MySQL database in Ubuntu

H
  1. Open a new Terminal Window.
  2. Type in the following command:
    mysqldump -h localhost -u root -pPASSWORD database > backup.sql
  3. This will backup the database to the file backup.sql
  4. -h = Hostname
    -u = Username
    -p = Password, no space between the p and the password allowed

NOTE: Has been tested on Ubuntu 9.04 and mySql 5.0.75

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