A daily pit: com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure

A pit of the day: pits about MyBatis

When using mybatis, there are many pitfalls. If you encounter things such as:

com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure (database connection error)

Don't rush to question whether your code is wrong, because the place where this error occurs is to connect to the database.
Go here first to see if the character matches your mistake:
Click to see the blogger's explanation
If not, then you probably made a critical mistake: that is the problem of opening the database service.
Win+R
input: net start mysql
to start the mysql service.
Really pit~

Guess you like

Origin blog.csdn.net/qq_44918802/article/details/119177878