UBB.Dev
Posted By: ScottCargill MysqlDump - 08/26/2002 3:44 AM
Quick question for you sql guru's

I did a mysqldump <filename.sql and for whatever reason only got about 90% of the messages put back. Course we didn't really notice it for a week or so.


The question is if I try to run mysqldump <filename.sql again, will it wipe out or cross circuit everything or just fill in the blanks..???

Posted By: Gardener Re: MysqlDump - 08/26/2002 4:39 AM
It will overwrite the old file with a new file that should be a complete dump of database, if nothing goes wrong.
Posted By: ScottCargill Re: MysqlDump - 08/26/2002 5:01 AM
I was kind of hopeing that I could import the old data on top of the live database, figuring that the message numbers and what not would fill in the blanks....

By your reply though I'm gonna guess that it would just overwrite everthing back to what and where we were two weeks ago.??

Posted By: Gardener Re: MysqlDump - 08/26/2002 5:19 AM
Ah, you mean that you imported a dumped file into the database and not all rows were added? This is done with the command "mysql", which is why I was confused.

You could probably use the following command to import the file again:
code:

mysql -f database < backup-file.sql



The flag -f tells the mysql command to continue on errors, which means it should import the missing rows. You would get errors for each row that already is in the database though, but that shouldn't matter.

I haven't tried this though, so you are doing at your own risk. Make a new backup of your database first before you try anything.
Posted By: ScottCargill Re: MysqlDump - 08/26/2002 6:19 AM
Well it's worth a shot..... Thanks!

Posted By: ScottCargill Re: MysqlDump - 08/26/2002 7:01 AM
Nope. Well that was worth a try, but nope...

All it did was pull in the old database wiping out any changes that had been made in the last couple of weeks.

For whatever reason the old dump just didn't keep all of the messages, we ended up with the indexes and post counts saying we'd had a good recovery, but they were in error and until recently we didn't double check posts 6 months old or older so we didn't catch the problem.

Oh well, we tried. The site in question isn't a real mover and shaker so no major harm done.

Good thing I made that backup as you suggested though! heh heh

Posted By: Gardener Re: MysqlDump - 08/26/2002 7:33 AM
Are there any DROP TABLES commands in the dump file? Some dumps may have this and it would remove anything that is already in the database. If this is the case, you can just remove those lines and the CREATE TABLE bits as well.
Posted By: 1QuickSI Re: MysqlDump - 08/26/2002 6:03 PM
Here is the dump command I use and never had a problem re-importing the data.

mysqldump -qce -r 08252002.sql -u root ubb
© UBB.Developers