Home > UNIX > Make local backup of MySQL DB

Make local backup of MySQL DB

To make a local backup of a MySQL DB use the mysqldump command. This information is available all over the internet, but here it is again (In case I once again forget and have to search for it, thats the problem with things you rarely have to do).

Here is the most common option, read the man page for further needs:

root@TEST#mysqldump –user %U –password=%P –all-databases > mysql.dump

mysqldump : utility to backup the db
–user : in place of %U enter the username of a mysql account with access
 –password= : in place of %P enter the password of the account, make sure there is no space and the = is there
 –all-databases : this creates a dump of all databases, see man file for individual db’s or tables
 > : redirect, in this case we are redirecting to a file called mysql.dump in the current directory

Advertisements
Categories: UNIX
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: