w13221412326
2021-07-30 10:05
采纳率: 100%
浏览 119

从yml中读取mysql配置,数据库已经存在,但还是出现数据库未找到的报错信息

yml文件

server:
    port: 8080

spring:
    datasource:
      driveClassName: com.mysql.cj.jdbc.Driver
      url: jdbc:mysql://localhost:3306//bank?useUnicode=true&CharacterEncoding=UTF-8&serverTimezone=utf&useSSL=false
      username: root
      password: 123456

jpa:
  hibernate:
    ddl-auto: none
  show-sql: false

报错:

2021-07-30 05:57:10.685 ERROR 5280 --- [           main] o.a.tomcat.jdbc.pool.ConnectionPool      : Unable to create initial connections of pool.

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown database '/hive'
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_292]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_292]
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_292]
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[na:1.8.0_292]

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

6条回答 默认 最新

相关推荐 更多相似问题