Log in Go to the main page Page History Go to the file list Go to the site toolbox

Backup A MySQL Database

From NetworkStuff


Mysql.svg

Use the following command and syntax to backup a MySQL database;

mysqldump --database database_name -u username -p --add-drop-table -B > file_name.sql

You will be prompted to enter the password for the specified user account.

Accessories-text-editor-v2-medium.png Usage Notes

The .sql extension is optional.

To add the current date to the filename, use the following command syntax;

mysqldump --database database_name -u username -p --add-drop-table -B > file_name-`date +%y-%m-%d`.sql

Icemon-medium.png Related Commands

See our MySQL Command articles.

Icemon-medium.png Related Articles

Should you need to restore a MySQL database, see our Restore A MySQL Database article

Take a look at our other MySQL and How To... articles

Information on Linux commands Tux-small.png

Information on F5 BigIP commands F5-logo-small.png

Information on Cisco commands Cisco-logo-small.png

Information on Windows commands Preferences-system-windows-small.png

Information on Vyatta commands Vyatta-logo-small.png

Information on Extreme commands Extreme-logo-small.png

Information on Nortel commands Nortel-logo-small.png

Information on Zebra commands

Information on Secure Platform commands

Information on Blue Coat SGOS commands

Information on Nokia IPSO commands


Internet-group-chat-small.png We really do appreciate all feedback so please do send your comments, suggestions or corrections to steve#networkstuff.eu (replacing the # with an @)


Personal tools
This page was last modified on 18 June 2009, at 12:54. - Disclaimers - About Network Stuff
Powered by MediaWiki