This time to customers to install test Ineedle equipment, but the installation will not immediately have data display, can not be fully displayed to the user web interface of some information. At this time need to have a public network server to display the Ineedle statistics, but the company 58 device No traffic, the recent data has not been updated, so prepare the actual data in the database for a few days to change the date, so that it shows the Ineedle Web interface. The latest seven-day data is 2015.07.27--2015.08.02 7 days of data, exactly one weeks. The plan is to revise 2015.07.27-2015.08.02 to 2015.10.19-2015.10.25.
Method:
Example:
Date back 3 days
Update Apache_5min_flow Set Record_date=adddate (Record_date, 3) where record_date= ' 2015-08-05 ';
Date forward 3 days
Update Apache_5min_flow Set Record_date=subdate (Record_date, 3) where record_date= ' 2015-08-05 ';
Process:
Test date is present
Select distinct record_date from Apache_5min_flow where record_date between ' 2015-07-27 ' and ' 2015-08-02 ';
Apache Start
Update Apache_5min_flow set Record_date=adddate (record_date) where record_date between ' 2015-07-27 ' and ' 2015-08-02 ' ;
Update apache_5min_request set Record_date=adddate (record_date) where record_date between ' 2015-07-27 ' and ' 2015-08-02 ';
Update Apache_cpuload_info set Record_date=adddate (record_date) where record_date between ' 2015-07-27 ' and ' 2015-08-02 ';
Data, mamicode.com "style=" color: #ffffff "target=" _blank ">mysql Database Modified Date--build data