Solutions to access denied for user ‘xxx’ @’localhost ‘problem
Key to error reporting
java.sql.SQLException : access denied for user ‘xxx’ @’localhost ‘(using password: Yes). Note that XXX here is not root, root is a permission problem
Solution
Change the user name for the configuration file
You can choose any name you like
And then 🆗 It’s over
Cause analysis
The framework did not get the correct user name of datasource, which is related to the configuration. When such a framework constructs an instance of abstractdriverbaseddatasource, the user name it gets is always the current machine name, that is, XXX. The underlying reason is not clear.