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:
|
>>: Vue+echart realizes double column chart
Table of contents Preface Introduction Live Easy ...
Suggestion: Handwriting code as much as possible c...
MyISAM and InnoDB are the most common storage eng...
Since Zabbix version 3.0, it has supported encryp...
Mouse effects require the use of setTimeout to ge...
1. Check the maximum number of open files in the ...
As usual, today I will talk about a very practica...
If you are using Alibaba Cloud Server, you need t...
Table of contents frame First-class error reporti...
Preface Samba is a free software that implements ...
Ubuntu Server 16.04 MySQL 8.0 installation and co...
The function has been implemented a long time ago...
Table of contents How to represent the current ti...
About Recently, in the process of learning Vue, I...
This article uses an example to illustrate the us...