The program encountered an error while connecting to the remote MySQL server java.sql.SQLException:Access denied for user ' root ' @ ' 192.168.27.129 ' (using Password:yes)
Native IP is ' 192.168.27.129 '
Go to the MySQL command line:
Mysql>use MySQL;
Mysql>select host,user from user;
See the information below, there is no limit to not allow the computer to connect to MySQL.
+-----------------------+------+
| Host | user |
+-----------------------+------+
| % | Root |
| 127.0.0.1 | Root |
| :: 1 | Root |
| localhost | Root |
| Localhost.localdomain | Root |
+-----------------------+------+
is the default not to let root remote login??
Mysql>grant all privileges on * * to ' root ' @ '% ' identified by ' Xuxu ' with GRANT OPTION
Permission to access data to any host
3, Mysql>flush privileges
Program again with root and password, log in, the result is successful!
Java.sql.SQLException:Access denied for user ' root '