Mysql: A time zone-MySQL

Source: Internet
Author: User
A problem with mysql time zone bitsCN. A problem caused by a time zone in commysql was recently reported by a customer. during the use of ERP 2BizBox, the following problem was found: when viewing the report profit and loss statement of the financial module, modify the time parameter, the profit and loss report data has not changed.

After multi-party verification, we finally found that the query of BizBox 2 was correct, but it was caused by the customer's modification of the system's default time zone. For more information, see 2BizBox. 2BizBox is a heavy query when processing the income statement query, therefore, data is first queried from multiple tables and cached in a temporary table. in this way, the query interval is determined next time, if the interval between the current query time and the last query time is less than 3 seconds, data is directly retrieved from the temporary table, this is to prevent the same user from querying multiple times at the same time, causing a burden on the system. The last query time is stored in the database. The current query time is the current time of the system, which can be executed stably in the normal system. If the time zone settings of the server operating system and data are inconsistent, the time of this query may be less than the time of the last query. Therefore, data will be retrieved from the temporary table, instead of updating the data in the temporary table. For example, if the database time zone is CST (UTC-6 hours) and the operating system time zone is CDT (UTC-5 hours), the system time Database time will be one hour. In this way, when a query parameter is changed after a query, data will not be updated if the time interval is one hour, therefore, the query parameters are changed and the report data remains unchanged. The solution is of course simple: Change the mysql time zone to the same as the system time zone. Author: netcybitsCN.com

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.