top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Database backup and restoration in MYSQL

+1 vote
520 views

I would like to listen your opinion about a situation. There is a function that is able to REMOVE all data from an specific date ?

I mean ... We are developing a demo script website, where users can join and test our system.

We need a database reset every 3 hours ... Delete all new data and back all changes to a default point. Better do that with php or mysql has an internal function that handle this.

posted Jul 6, 2013 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

3 Answers

+1 vote
 
Best answer

You can do it in MySQL, using Event Scheduler. Event Scheduler is similar to the idea of the Unix CronTab

More details on MySQL Site - http://dev.mysql.com/doc/refman/5.6/en/events-overview.html

answer Jul 9, 2013 by Sudheendra
0 votes

mysqldump -u username -ppassword database > dump.sql
mysql -u username -ppassword database < dump.sql

answer Jul 6, 2013 by anonymous
0 votes

are you talking about removing whole data from the tables or just specific data inserted at some time? you can do this different ways..

First way:
1) add a field indicating current time of insertion (for example: insert_date)
2) DELETE FROM table WHERE insert_date I mean ... We are developing a demo script website, where users can join

answer Jul 6, 2013 by anonymous
...