Local can link to the server database, upload jar package to the server will report an error

Question:

The problem encountered in the project is very strange. MySQL database is installed on CentOS, and the project is spring boot.

When the project is started locally, it is normal to connect to the server database, the local database client is normal to connect to the server database, and the server is normal to connect to the client database. When the project is deployed to the server, an exception is thrown.

A lot of misinformation..

The most important thing is:

java.sql.SQLException: Access denied for user ''@'localhost' (using password: YES)

reason:

I forgot to repack every time you run a project, idea will not help you repackage it. You need to do it yourself

Other questions can be referred to

https://www.cnblogs.com/secbro/p/12544158.html

Read More: