MySQL Error: The server time zone value is unrecognized or represents more than one time zone

Source: Internet
Author: User

When programming to access the MySQL database, the time zone error is reported as follows:

The server time zone value ' й ' is unrecognized or represents more than one time zone

There are usually two workarounds:

First, add the SERVERTIMEZONE=UTC after the database connection statement, which is the default 0 time zone, but be aware that the statement needs to follow the first location of the database connection statement, otherwise it will be an error, for example:

Jdbc.url=jdbc:mysql://localhost:3306/testdatabase?servertimezone=utc&useunicode=true&characterencoding =utf-8

However, there is a problem that when you insert a time field into the database, the time is 8 hours earlier than the current time, that is, the current system time is reduced by 8 hours.

Second, modify the MySQL time zone to the East 8 zone, execute the following command:

Set global time_zone= ' "


MySQL Error: The server time zone value is unrecognized or represents more than one time zone

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.