# To dump a database to a SQL file
$ mysqldump mydatabase > mydatabasedump.sql

# To import a database form an SQL file
$ mysql myremotedatabase < mydatabasedump.sql
Out of scientific curiosity, I went digging -- if you're using InnoDB, these appears to not be transactionally safe(much like FB's ascii dump). If you're using MyISAM, you have no transactions, so your database is already broken :). For InnoDB, though, you can use mysqldump --single-transaction dbname which will give you a transactionally safe dump. MySQL is not, however, transactionally safe for alter table statements. For most cases this won't be a problem, but if you try to dump the db while running migrations, you'll get corrupted results. If you're using MyISAM, you should do a --lock-tables, which has the obvious downside of .... locking the tables ... but if you're using this for backup, you really should be doing it.

ms

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to