Select Page

How to backup a MySQL database in Ubuntu

  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

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.