使用spring boot 写了一个简单的后端程序但无法运行

使用spring boot 写了一个简单的后端程序程序部分没有显示error但在运行的时候出现如下错误

2023-02-07 13:29:33.274  INFO 11108 --- [  restartedMain] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1220 ms
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
2023-02-07 13:29:33.402  INFO 11108 --- [  restartedMain] o.hibernate.jpa.internal.util.LogHelper  : HHH000204: Processing PersistenceUnitInfo [name: default]
2023-02-07 13:29:33.451  INFO 11108 --- [  restartedMain] org.hibernate.Version                    : HHH000412: Hibernate ORM core version 5.6.14.Final
2023-02-07 13:29:33.640  INFO 11108 --- [  restartedMain] o.hibernate.annotations.common.Version   : HCANN000001: Hibernate Commons Annotations {5.1.2.Final}
2023-02-07 13:29:33.733  INFO 11108 --- [  restartedMain] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Starting...
2023-02-07 13:29:33.735  WARN 11108 --- [  restartedMain] com.zaxxer.hikari.util.DriverDataSource  : Registered driver with driverClassName=com.mysql.jdbc.Driver was not found, trying direct instantiation.
2023-02-07 13:29:35.350 ERROR 11108 --- [  restartedMain] com.zaxxer.hikari.pool.HikariPool        : HikariPool-1 - Exception during pool initialization.


以及

2023-02-07 13:29:35.352 ERROR 11108 --- [  restartedMain] j.LocalContainerEntityManagerFactoryBean : Failed to initialize JPA EntityManagerFactory: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
2023-02-07 13:29:35.354  WARN 11108 --- [  restartedMain] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
2023-02-07 13:29:35.358  INFO 11108 --- [  restartedMain] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2023-02-07 13:29:35.369  INFO 11108 --- [  restartedMain] ConditionEvaluationReportLoggingListener : 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2023-02-07 13:29:35.392 ERROR 11108 --- [  restartedMain] o.s.boot.SpringApplication               : Application run failed



我这里好像上传不了图片,两张截图在下面链接:
https://imgloc.com/i/rM12P
https://imgloc.com/i/rMTuC

报错是未知的数据库,看下数据库名是不是写错了。
另外最好能贴一下你关于数据库那块的配置。看着好像驱动类也过时了,应该替换成"com.mysql.cj.jdbc.Driver"

你这是连接不上数据库啊。要先确保数据库是启动的,并且可以正常连接,然后检查一下springboot的数据库配置是否正确。

您好,我是有问必答小助手,您的问题已经有小伙伴帮您解答,感谢您对有问必答的支持与关注!
PS:问答VIP年卡 【限时加赠:IT技术图书免费领】,了解详情>>> https://vip.csdn.net/askvip?utm_source=1146287632不知道你这个问题是否已经解决, 如果还没有解决的话:

如果你已经解决了该问题, 非常希望你能够分享一下解决方案, 写成博客, 将相关链接放在评论区, 以帮助更多的人 ^-^