java is denied access to the database, the database is not connected ERROR 1045 (28000): Access denied for user 'root' @ 'localhost' (using password: YES)

Cause of error: mysql database only allows local ip access;

Workaround: Modify the mysql table settings for all ip are accessible;

Log database using the following command:

use mysql;
. Grant All privileges ON * * to ' root ' @ ' % ' IDENTIFIED by ' your database password ' ;
flush privileges;

 

To see if the amendment is successful 

select host,user from user;

 

Guess you like

Origin www.cnblogs.com/it1997/p/11183383.html