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. :(