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
1. Overview There are three ways to create a Dock...
Implementing process analysis (1) How to call rep...
MySQL official website: https://www.mysql.com/dow...
Official Website https://cli.vuejs.org/en/guide/ ...
Table of contents In vue2 In vue3 Notes on setup ...
1. Introduction to Middleware 1. Basic concepts E...
SVG (Scalable Vector Graphics) is an image format...
Step 1: Get the MySQL YUM source Go to the MySQL ...
Preface This article mainly introduces the releva...
Preface When creating a primary and foreign key f...
What is pip pip is a Python package management to...
<meta name="viewport" content="w...
Table of contents Preface Introduction to Closure...
Recently, the server has been frequently cracked ...
Purchase Certificate You can purchase it from Ali...