问题描述

  • 问题:

org.springframework.transaction.CannotCreateTransactionException: Could not open JPA EntityManager for transaction; nested exception is org.hibernate.exception.GenericJDBCException: Unable to acquire JDBC Connection

  • 找到原因

Caused by: java.sql.SQLException: Access denied for user ''@'localhost' (using password: NO)

  • 问题查找

application.yml文件

#2、数据库连接池
datasource:
	drive-class-name: com.mysql.cj.jdbc.Driver
	url: jdbc:mysql://localhost:3328/moms?userUnicode=true&characterEncoding=utf8
	data-username: root
	data-password: 123

问题解决

application.yml配置文件中usernamepassword前面不能加 data-

#2、数据库连接池
datasource:
	drive-class-name: com.mysql.cj.jdbc.Driver
	url: jdbc:mysql://localhost:3328/moms?userUnicode=true&characterEncoding=utf8
	username: root
	password: 123

总结

具体缘由以后再说,任务要紧

相关文章:

  • 2022-12-23
  • 2021-05-27
  • 2021-04-15
  • 2021-11-16
  • 2021-11-20
  • 2021-04-06
  • 2022-01-19
猜你喜欢
  • 2021-08-26
  • 2022-12-23
  • 2021-12-25
  • 2022-12-23
  • 2022-12-23
  • 2021-12-15
  • 2018-11-09
相关资源
相似解决方案