Access denied for user 'root'@'222.128.172.12'

it2022-05-05  136

java.sql.SQLException: Access denied for user ‘root’@‘222.128.172.12’ (using password: YES) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1055) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3536) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3468) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:917) at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:3974) at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1282) at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2142) at com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:773) at com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:46) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

解决:

进入 mysql ;

use mysql;

然后 执行

GRANT ALL PRIVILEGES ON . TO root@“你.的.端.口” IDENTIFIED BY “你的密码” WITH GRANT OPTION;

FLUSH PRIVILEGES;


最新回复(0)