How To Do A Proper MySQL Dump (a backup of a mysql database)
| Databases |
# HOW-TO DO A PROPER MYSQLDUMP of all the mysql databases on a MySQL 4.x and 5.x server:
This topic can also be called " The Easy Way How-To: Backup a copy of your live databases in MySQL "
For anyone who's ever banged their head against a wall trying to understand how to protect their MySQL databases with a live, active, dynamic copy that will not force you to shut down your MySQL server, this article is for you.
So here we go.
1) To backup all datbases in MySQL, go to the command line, and run: mysqldump -S /var/lib/mysql/mysql.sock --password=your-database-password --user=your-mysql-admin-username -vv -r databasedump.mysql --all-databases
2) The command for importing all of the databases from the dumpfile onto any other MySQL server is:
mysql < dumpfile
Or as fits our above example:
mysql < databasedump.mysql
This will import all of the databases in databasedump.mysql onto the receiving MySQL server.
3) To Backup Just One Database at a time, use similar syntax; the difference is that you specify the database name instead of using "all-databases".
Example:
mysqldump -S /var/db/mysql/mysql.sock --password=open123sesame --user=admin -vv -r 2008_big_sports_archive_dump.mysql --2008_big_sports_archive
This will backup a copy of the "2008_big_sports_archive" into a dump file called " 2008_big_sports_archive_dump.mysql ".
more digital solutions found at:
xdose.com
ContentAndAds.com
FreeBSDRocks.net
GoodCleanEmail.com
TheSwamp.info
MySQL.org


