Restoring MySQL dump files
Posted: Thu Dec 04, 2008 1:37 am
I created a backup script to backup MySQL DB schemas some time ago.
I was playing with phpBB3 and accidentally deleted a post.
I then tried to get the post back, of course.
Fortunately, I have MySQL schemas backed up daily.
I found last night(this morning)'s backup and just needed to restore it.
Here is the command I issued:
I was playing with phpBB3 and accidentally deleted a post.
I then tried to get the post back, of course.
Fortunately, I have MySQL schemas backed up daily.
I found last night(this morning)'s backup and just needed to restore it.
Here is the command I issued:
Code: Select all
Syntax:
<PATH>/mysql -u<USER> -p <DB Name> < <SQL dump file>
Code: Select all
/usr/local/bin/mysql -udbuser -p phpBB3 < ./phpBB3-backup-20081203053506.sql
NOTICE wrote:
- DB user (dbuser) comes directly after "-u", no space in between.
- -p means the command will ask for user's password from command line.
- phpBB3 is the database (schema).
- MySQL dump file (phpBB3-backup-20081203053506.sql) is read into MySQL and all files are put into right place.