


How to solve the problem of com.mysql.cj.jdbc.Driver becoming popular in yml file in Springboot
The reason why com.mysql.cj.jdbc.Driver became popular in yml files
I built a framework a few days ago, and a strange problem occurred. When configuring the mysql file, com.mysql.cj .jdbc.Driver has been popular. I thought the version was too low, so I upgraded to a higher version, but it was still popular. Finally, I checked online for a long time. The online method said that the version was too low, but I still The dependency package I used before was not working:
<!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java --> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>8.0.15</version> </dependency>
Finally I just removed the version number,
<dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> </dependency>
driver-class-name: com.mysql.cj.jdbc.Driver code exploded Red's solution
When building and running the springboot project, an error will be reported when adding the database driver.
Before that, you need to add mysql dependency in pom.xml. In the process of seeking solutions to the problem many times, I found a key statement, which is:
I added the version number in the mysql dependency, and this problem is probably caused by inconsistent version numbers, which resulted in this red topic:
At this point, the solution to this problem is obvious.
1. Either comment out the mysql dependency in pom.xml
<!-- 数据库Mysql --> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <!--<version>5.7.17</version>--> </dependency>
logging: path: ./log/ spring: datasource: url: jdbc:mysql://localhost:3306/xzs?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false&serverTimezone=GMT%2b8 username: root password: root driver-class-name: com.mysql.cj.jdbc.Driver
2. Or the current MySQL version on the computer is too low, reinstall a MySQL version that is more suitable for the development environment.
The above is the detailed content of How to solve the problem of com.mysql.cj.jdbc.Driver becoming popular in yml file in Springboot. For more information, please follow other related articles on the PHP Chinese website!

Start Spring using IntelliJIDEAUltimate version...

When using MyBatis-Plus or other ORM frameworks for database operations, it is often necessary to construct query conditions based on the attribute name of the entity class. If you manually every time...

Java...

How does the Redis caching solution realize the requirements of product ranking list? During the development process, we often need to deal with the requirements of rankings, such as displaying a...

Conversion of Java Objects and Arrays: In-depth discussion of the risks and correct methods of cast type conversion Many Java beginners will encounter the conversion of an object into an array...

Solutions to convert names to numbers to implement sorting In many application scenarios, users may need to sort in groups, especially in one...

Detailed explanation of the design of SKU and SPU tables on e-commerce platforms This article will discuss the database design issues of SKU and SPU in e-commerce platforms, especially how to deal with user-defined sales...

How to set the SpringBoot project default run configuration list in Idea using IntelliJ...


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

Atom editor mac version download
The most popular open source editor

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment