Knowledge Base > Topic Categories > How to perform MySQL Dump / Restore

How to perform MySQL Dump / Restore

by Support

Dump:
To dump the contents of a MySQL database into a file:

[This is all one command line!]

/usr/local/mysql/bin/mysqldump $databasename -u $user -p**** > /home/$user/file.dump

Where:
- '$database' gets replaced with your MySQL database name, usually in the format domain_com
- '$user' gets replaced by your username
- '***' represents your MySQL database password. (It will look like:
-ppassword
remember not to leave a space there!)
- $user gets replaced by your account username
- 'file.dump' is the name of the file you wish to create for the database contents.

NOTE: REMEMBER YOU CANNOT STORE A MYSQL DUMP IN YOUR ACCOUNT IF YOU DO NOT HAVE SUFFICIENT DISK SPACE LEFT! Keep this in mind before performing a MySQL Dump!
------
Restore:
To restore a mysql database from a dump:
[this is one command line!]

/usr/local/mysql/bin/mysql $databasename -u $user -p**** < /home/$user/file.dump




Article Options

Email Article

Print Article |

Search | Contents | Glossary