The SpringBoot program connects to the Ali server mysql and appears Access denied for user'root'@'own computer's public network ip' (using password: YES)
I am using Ali server, and MySQL is installed in it. When connecting with SpringBoot, the error shown in the title appears. Access denied for user'root'@'own computer's public network ip' (using password: YES)
2. The first idea
The remote authority of the database is not open, so modify it
Enter MySQL
mysql -u root -p
Login after entering the password
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '你的数据库密码'
Refresh permissions
flush privileges;
After this was done, it was unsuccessful and still not resolved, so the problem does not appear here.
In the above configuration file, the name attribute is wrong, and name is the name of the datasource. Since it was not found before, we have been investigating it.
Modify, change to username, username is the attribute of logging in to the database