Location>code7788 >text

SpringBoot project using yml file link database exception

Popularity:538 ℃/2024-10-03 15:45:38

SpringBoot connecting to a database using properties without a problem

SpringBoot using yml to connect to the database appears: Unable to connect to Redis

and appears in the error message:

It was found that there was a problem with the user or password

We know that yml distinguishes data types by querying it, so if the username or password isdigital (electronics etc)If you do, be aware of the

Enclose the password in double quotes and recognize it as a string to connect properly
(If the password has special characters, they need to be enclosed in single or double quotes)

MYSQL is the same
In addition, if it is MySQL, you have to pay attention to the mysql version and the driver version.

mysql-connector-java MySQL jdbc JDK
8. 5.6、5.7、8.0 4.2 JDK 8.0 or higher
5. 5.6、5.7、8.0 3.0、4.0、4.1、4.2 JDK 5.0 and JDK 8.0 or later