mysql connection error errorCode 0, state 08S01

mysql connection error errorCode 0, state 08S01

When I first encountered this problem, all I checked online was to add it when connecting to the database.useSSL=false

spring.datasource.url=jdbc:mysql://localhost:3306/xxx?allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai

But I originally had the value corresponding to useSSL.
Environment: centos7, mysql8.0.33, jdk1.8
Background: I can log in through the command MySQL, and when I use the command systemctl status mysql, the displayed mysqlstatus is also runningrunning.

Solution:

  1. Stop mysql:service mysql stop
  2. Restart:service mysql start
  3. Check whether the startup is successful:systemctl status mysql
  4. Just restart the service again

Guess you like

Origin blog.csdn.net/weixin_44021888/article/details/132565240