Date modified on MySQL database--build data

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.