Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
08-11-2013, 07:35 AM #1
- Join Date
- Jul 2009
- Thanked 0 Times in 0 Posts
dropping database and replacing with backup
my vbulletin forum was full of thousands of spam users and messages
i decided to delete the current database and give it a fresh start from the backup
do i delete the existing database and upload my backup database? or do i drop tables and upload everything from database backup? also can you write me the syntax for dropping and reloading?
08-11-2013, 05:06 PM #2
- Join Date
- May 2005
- Southern tip of Silicon Valley
- Thanked 160 Times in 155 Posts
The answer depends on the options used when creating the backup. If you did a standard dump, then the file should have "drop table if exists table" statements and you could do a standard restore without dropping the database.
If you added new tables after making the backup dump and don't want them after the restore, then you'll need to drop the database then create the database only without tables and then do the standard restore.
Syntax for a standard restore is:
mysql -u user -p database < dump.sql
How to Back Up and Restore a MySQL Database
Last edited by FishMonger; 08-11-2013 at 05:10 PM. Reason: Added link to complete instructions