Failed to instantiate [co
m.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is java.lang.IllegalStateException: C
annot load driver class: com.mysql.cj.jdbc.Driver
原因可能是pom.xml文件中mysql依赖版本问题
将pom.xml mysql依赖修改一下
改成
<dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <scope>runtime</scope> </dependency>