項目啟動遇見:
WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
spring.datasource.url=jdbc:mysql://xxxxx:3306/name?Unicode=true&characterEncoding=UTF-8
出現該原因是政供,雖然已經建立了SSL的連接桥温,但是沒有進行身份驗證,所以會出現警告,但是不是報錯沉眶。
解決方案如下:
在連接數據庫的URL中加上:&useSSL=false該語句即可。
spring.datasource.url=jdbc:mysql://xxxxx:3306/name?Unicode=true&characterEncoding=UTF-8&useSSL=false