java to mysql connection error
conn = DriverManager.getConnection(
"jdbc:mysql://localhost:3306/DB, "root", "password");
error message:
Exception in thread "main" java.sql.SQLException: Data source rejected establishment of connection, message from server: "Host 'idwsg' is not allowed to connect to this MySQL server"
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:589)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:1654)
at com.mysql.jdbc.Connection.<init>(Connection.java:432)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:400)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at Simexecute.connectDB(Simexecute.java:3432)
at Simexecute.<init>(Simexecute.java:310)
at Simexecute.main(Simexecute.java:3461)
请问这个问题出在server, j2-re, java-connector, 还是 mysql-server 的configuration ?
"jdbc:mysql://localhost:3306/DB, "root", "password");
error message:
Exception in thread "main" java.sql.SQLException: Data source rejected establishment of connection, message from server: "Host 'idwsg' is not allowed to connect to this MySQL server"
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:589)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:1654)
at com.mysql.jdbc.Connection.<init>(Connection.java:432)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:400)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at Simexecute.connectDB(Simexecute.java:3432)
at Simexecute.<init>(Simexecute.java:310)
at Simexecute.main(Simexecute.java:3461)
请问这个问题出在server, j2-re, java-connector, 还是 mysql-server 的configuration ?