Results 1 to 3 of 3
Thread: mysqldump, then restore.
Jun 2, 2004, 05:59 #1
- Join Date
- Oct 2003
- 0 Post(s)
- 0 Thread(s)
mysqldump, then restore.
Ok, I'm setting up part of my website as a DEMO, and I want it to be refreshed every so often.
This application that I'm using uses a MYSQL database. So I'm having problem restoring the Database, when it already has tables and data.
So I use this to dump the database:
mysqldump --opt -h localhost -uroot -ppassword dbname > dbname.sql
When I try to restore the DB, when there are existing tables/data, nothing changes: BTW, I use this to restore:
mysql -h localhost -uroot -ppassword dbname < dbname.sql
This will work if I DROP all the tables and data though.
So I'm trying to automate all of this through a CRON JOB, and if I can work around this issue, that won't be a problem.
So what are my options? I thought with the --opt that it would drop any existing tables and solve this, but it doesn't.