- Microsoft Windows chief decries standards grandstanding
- The 5 best, and 5 worst, features of Google Chrome OS
- Federal government using PS3 to crack pedophile passwords
- 10G Ethernet cheat sheet
- Top 10 free Windows tools for IT pros, at a glance
After reading your story on Copying MySQL databases, I would like to know whether a MySQL database can be copied from one machine to another using the mysqldump command instead of taking a snapshot by copying the data directory.
The mysqldump command can be used to export MySQL database data for one database at a time or for all MySQL data.
According to the documentation, you should consider using the mysqlhotcopy instead if you are backing up a server. Unfortunately, mysqlhotcopy might not work very well on Windows systems, and it can only be run on the system that has the database directories.
The mysqldump command uses a syntax that looks like
mysqldump [options] db_name [tables]
where entire databases will be dumped if you do not name any tables. You can replace the db_name and tables list with "-all-databases" to dump everything.
For MySQL versions prior to 4.1, include the -opt option in your command; otherwise, the entire result set gets loaded into memory before anything is dumped.
Loading your dumped data into another MySQL system can be done by using the "mysqlimport" command.
Comments (1)
The best way to copy a MySQL database to another machineBy Anonymous on December 19, 2006, 2:23 pmmysqldump Re: This article.
Reply | Read entire comment
View all comments