IDEA reports an error when connecting to MySQL! Server returns invalid timezone. Go to tab and set serverTimezone property

IDEA reports an error when connecting to MySQL! Server returns invalid timezone. Go to tab and set serverTimezone property

The road ahead is always so difficult and full of thorns. Grit your teeth and believe that you can get through it. Come on, come on!

Error screen

IDEA connects to MySQL, the address, username, password, and database name are all configured. Click test connection. Click! unsuccessful!

The interface is like this,

Translated: The server returned an invalid time zone. Go to the Advanced tab and manually set the serverTimezone property.

Looks like there's a time zone issue. How can time zones be a problem? There are so many pitfalls. I searched for various solutions online and there were so many, some complex and some simple, but I finally solved it!

Solution

My problem lies in two parts. First, setting the time zone of MySQL. Second, the version of MySQL driver. The detailed steps are as follows:

First, set the MySQL time zone.

1. Let's check the MySQL time zone first.

(Here is a little episode~~~~~~~Have you configured the environment variables for your mysql?)

After configuring the environment variables, you can execute the following commands directly in the command window!

Enter the command window (Win + R), connect to the database mysql -hlocalhost -uroot -p, press Enter, enter the password, and press Enter, as shown in the figure:

2. Continue to enter show variables like'%time_zone'; (be careful not to miss the semicolon at the end), and press Enter, as shown in the figure:

If it shows SYSTEM, it means that the time zone is not set.

3. Now let's set the time zone.

Enter set global time_zone = '+8:00'; be careful not to miss the semicolon at the end), and press Enter, as shown in the figure:

This is a successful setup!

At this time, you can reconnect to the database and maybe it will be successful! If not, keep going!

Second, synchronize the MySQL driver.

The MySQL version installed on my computer is 5.7, so IDEA should also match the driver version to connect to MySQL. Just change the Driver to MySQL for 5.1

Click Test Connection to test, success!

【Replenish】

If you choose MySQL,

It doesn't matter if the database is of another version.

Find MySQL in the driver list, select the version you need in Driver files on the right, and save it.

Summarize

This is an article about IDEA connecting to MySQL and reporting an error! Server returns invalid timezone. Go to 'Advanced' tab and set 'serverTimezone' property This is the end of the article. For more related idea connection mysql error content, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Tutorial on return and goto statements used for jumps in C++ flow control
  • Golang return omitted usage instructions
  • Python Django view two ways to implement return
  • return statement in go language

<<:  Solve the problems that need to be paid attention to when configuring Tomcat's maxPostSize attribute

>>:  Vue+echart realizes double column chart

Recommend

The implementation of Youda's new petite-vue

Table of contents Preface Introduction Live Easy ...

How to customize more beautiful link prompt effect with CSS

Suggestion: Handwriting code as much as possible c...

Explanation of the configuration and use of MySQL storage engine InnoDB

MyISAM and InnoDB are the most common storage eng...

Zabbix's psk encryption combined with zabbix_get value

Since Zabbix version 3.0, it has supported encryp...

JavaScript to achieve mouse tailing effect

Mouse effects require the use of setTimeout to ge...

How to implement Hover drop-down menu with CSS

As usual, today I will talk about a very practica...

Recommended plugins and usage examples for vue unit testing

Table of contents frame First-class error reporti...

Complete steps to use samba to share folders in CentOS 7

Preface Samba is a free software that implements ...

Ubuntu Server 16.04 MySQL 8.0 installation and configuration graphic tutorial

Ubuntu Server 16.04 MySQL 8.0 installation and co...

Using better-scroll component in Vue to realize horizontal scrolling function

About Recently, in the process of learning Vue, I...