[IDEA] Solve the problem that the driver cannot be downloaded when connecting to Mysql8.0 in idea

This article follows [idea] to solve problems encountered in sprintboot project creation 2-CSDN Blog

Table of contents

一、Failed to download 'https://download.jetbrains.com/idea/jdbc-drivers/MySQL/8/LICENSE.txt':Remote host terminated the handshake

二、no dirver files provided com.mysql.cj.jdbc.Driver

三、Server returns invalid timezone. Need to set 'serverTimezone' property. 


My locally installed mysql version is 8.0.35,

一、Failed to download 'https://download.jetbrains.com/idea/jdbc-drivers/MySQL/8/LICENSE.txt':
Remote host terminated the handshake

Error: An error occurs when connecting to Mysql8.0 in idea.

Reason: Failed to install driver Jar package

Solution: After opening Drivers, I found that the automatic download of version 8.0.25 failed.

I found this Zhihu article on the Internet and planned to try the method of manually configuring the jar package mentioned here.

When connecting to Mysql8.0 in IDEA, the driver cannot be downloaded - Zhihu (zhihu.com)

Baidu Skydisk

Link:  https://pan.baidu.com/s/1Mw9qAdbuv67RMNmR1Zyb-Q?pwd=ning  Extraction code: ning

Download the driver jar package of version 8.0.29 and configure it in idea.

I don’t know why, but after testing the connection to the database, I still got an error: no dirver files provided.

Please continue reading below for how to resolve the error.

二、no dirver files provided com.mysql.cj.jdbc.Driver

Error: no dirver files provided,

Reason: When pycharm imports the MySQL driver , it cannot recognize it successfully and displays red fonts.

Solution: Click the blue reminder box Config Driver. After jumping to the page, click to download the driver version according to the process shown in the figure below (here I downloaded version 8.0.21).

Just wait here to download the driver.

Then you can also delete the redundant 8.0.29 version imported before to avoid confusion.

After testing the connection to the database, I still found an error: Server returns invalid timezone. Need to set 'serverTimezone' property.

Please continue reading below for how to resolve the error.

三、Server returns invalid timezone. Need to set 'serverTimezone' property. 

Error: When creating a new Mysql connection, an exception is prompted during the "Test Connection" test.

Reason: This situation occurs because the time zone is not configured when installing MySQL. The default time zone in the MySQL-driven jar package is UTC, which represents global standard time, but the time we use is the Beijing time zone, which is the East Eighth District, eight hours ahead of UTC, which is obviously a mismatch. Because the time zone is inconsistent, an invalid time zone is returned, which leads to the above problem.

Workaround: Specify the current time zone for the database.

Configure the time zone in config, click [Set time zone], jump to the [Advanced] tab and manually set the [serverTimezon] attribute value.

Change the default attribute "UTC" of [serverTimezon] to "GMT" and remember to click "Apply" to take effect;

OK, finally solved.

Guess you like

Origin blog.csdn.net/qq_45956730/article/details/135445494