当前位置:网站首页>The MySQL password is correct, but the startup error is unable to create initial connections of pool Access denied for user ‘root‘@‘localhost
The MySQL password is correct, but the startup error is unable to create initial connections of pool Access denied for user ‘root‘@‘localhost
2022-07-22 18:25:00 【scluis】
problem
Recently imported a SpringBoot project , After local configuration , The error is always reported when the project is started :
2020-12-17 15:46:42.136 ERROR 19320 --- [restartedMain] o.a.tomcat.jdbc.pool.ConnectionPool : Unable to create initial connections of pool.
java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
At first, I thought the database password was wrong , But after checking it several times, I found that the password was ok , There are two ways online :
1. When configuring the database username and password Write the data
FALSE :
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/hah
spring.datasource.data-username=root
spring.datasource.data-password=123456
Modified :
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/hah
spring.datasource.username=root
spring.datasource.password=123456
2.Yml Double quotation marks should be added when configuring the password of the database in the configuration file
spring:
datasource:
driver-class-name: com.mysql.jdbc.Driver
url: jdbc:mysql://localhost:3306/blog?useUnicode=true&characterEncoding=utf-8
username: root
password: "123456"
however , Neither of these methods has solved my problem
terms of settlement
1. Open the installation mysql The location of the database , stay my.ini Add... At the end of the configuration file
skip-grant-tables
2. restart MySQL service
The reason for this error is that the code is executing sql Statement error and lost login permission
边栏推荐
- 抖音巨量引擎1 创建广告计划
- Industrial Internet security situation prediction method integrating attention mechanism and bsru
- 反射+注解+泛型
- 需要达到什么水平,程序员才能顺利拿到20k月薪无压力?
- Installation and introduction of Lin UI component library of wechat applet - Advanced
- 「武汉理工大学 软件工程复习」第五章 | 软件体系结构
- 关于STemwin中,外部实体按键操作Spinbox控件(fishing_2)
- "Review of software engineering in Wuhan University of technology" Chapter 7 | software testing
- 【10点公开课】:云视频会议系统私有化实践
- Yunyuanyuan (10) | introduction to kubernetes in kubernetes
猜你喜欢
【10点公开课】:云视频会议系统私有化实践
Fabric.js 居中元素
Female guest registration
【Rust】为什么我建议你学一下 Rust | Rust 初探
QT笔记—— QTableWidget 之 拖拽行数 和 移动
Computer network learning notes 7-tcp programming process and interview questions
Yunyuanyuan (10) | introduction to kubernetes in kubernetes
GeoWebCache发布ArcGIS切片数据
「武汉理工大学 软件工程复习」第六章 | 编码规范
QT笔记——QtXml
随机推荐
【Rust】我该用什么软件开发 Rust | 常用支持 Rust 的编辑器推荐
Use of bullets in object pool mode in aircraft war
Gbase8s database restrictions on set collection
Verilog basic syntax (2)
化繁为简,聊一聊复制状态机系统架构抽象
QT笔记——网络通信 之 QUdpSocket
"Review of software engineering in Wuhan University of technology" Chapter 6 | coding specification
flutter 线性布局让两个控件充满一行
Rocky基础练习题-shell脚本-1
Fabric.js 居中元素
"Review of software engineering in Wuhan University of technology" Chapter III software requirements
QT notes - vs generating multiple exe files for a project
QT笔记——eventFilter事件过滤器
What level do programmers need to reach to get 20K monthly salary without pressure?
Internet Download Manager2022智能win最新版下载器
线程学习笔记
「武汉理工大学 软件工程复习」第六章 | 编码规范
QT筆記—— QTableWidget 之 拖拽行數 和 移動
43. String multiplication
QT notes - qjason