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 mysql
status is also running
running.
Solution:
- Stop mysql:
service mysql stop
- Restart:
service mysql start
- Check whether the startup is successful:
systemctl status mysql
- Just restart the service again