How to duplicate a MySQL database on the same server
The mysql command line client will accept a stream of SQL statements from standard input. You can therefore pipe the output of mysqldump directly into mysql on the command line. Doing this as a cron job will regularly overwrite your test data with updated live data: mysql –user=username –password=passwd -e ‘DROP DATABASE test_db;’ mysql –user=username … Read more