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


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)


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


Read More: