Failed to initialize JPA EntityManagerFactory: Unable to create requested service


1、错误场景
2022-01-25 10:56:57.142 ERROR 18484 --- [ restartedMain] j.LocalContainerEntityManagerFactoryBean : Failed to initialize JPA EntityManagerFactory: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]

2、错误原因
MySQL数据库

3、解决办法
1)检查MySQL服务有没有打开

2)检查项目的数据源配置是否错误,如用户名或者密码错误,url语法错误导致无法正常访问等。(自身所犯错误:url写错。是jdbc:mysql://...却错写成cj.jdbc:mysql//...)

核对自己的用户名、密码、端口号等。diver—class—name这个参数的写法也要注意,高版本(即8.0及以上)的MySQL数据库是cj.jdbc.driver而不是jdbc.driver

参考网址
https://blog.csdn.net/air__Heaven/article/details/119960013
https://blog.csdn.net/xiaozhegaa/article/details/69230127
https://www.cnblogs.com/Ran-Chen/p/9646187.html
https://blog.csdn.net/weixin_42125700/article/details/80245177
https://blog.csdn.net/wdxgj123/article/details/106603704
https://blog.51cto.com/zero01/2294152
https://www.cnblogs.com/borter/p/12424049.html


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM