java.sql.SQLException: null, message from server: "Host '10.11.3.67' is not allowed to connect to t
2018-01-08 16:24
676 查看
在centos7 中启动的docker容器,后台报出这个错误 ,我这是拟机中的容器连接宿主机上的mysql,这是一个常见的错误,记录下来,mysql 不允许远程连接导致的:
java.sql.SQLException: null, message from server: "Host '10.11.3.67' is not allowed to connect to this MySQL server"
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:996) ~[mysql-connector-java-5.1.34.jar!/:5.1.34]
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:935) ~[mysql-connector-java-5.1.34.jar!/:5.1.34]
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:924) ~[mysql-connector-java-5.1.34.jar!/:5.1.34]
在mysql 中给相应的用户附权,执行以下脚本:
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;
重启服务,即可
java.sql.SQLException: null, message from server: "Host '10.11.3.67' is not allowed to connect to this MySQL server"
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:996) ~[mysql-connector-java-5.1.34.jar!/:5.1.34]
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:935) ~[mysql-connector-java-5.1.34.jar!/:5.1.34]
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:924) ~[mysql-connector-java-5.1.34.jar!/:5.1.34]
在mysql 中给相应的用户附权,执行以下脚本:
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;
重启服务,即可
相关文章推荐
- 远程mysql_java.sql.SQLException: null, message from server: "Host 'xxx' is not allowed to connect
- 远程mysql_java.sql.SQLException: null, message from server: "Host 'xxx' is not allowed to connect
- java.sql.SQLException: null, message from server: "Host 'xxx' is not allowed to connect
- java.sql.SQLException: null, message from server: "Host 'xxx' is not allowed to connect
- java.sql.SQLException: null, message from server: "Host 'xxx' is not allowed to connect
- java.sql.SQLException: null, message from server: "Host 'xxx' is not allowed to connect to this MySQ
- java.sql.SQLException: null, message from server: "Host '192.168.1.101' is not allowed to connect
- java.sql.SQLException:null, message from server: "Host '192.168.0.131' is not allowed to connect.
- java.sql.SQLException: null, message from server: "Host 'xxx' is not allowed to connect
- java.sql.SQLException: null, message from server: “Host ‘xxx’ is not allowed to connect
- java.sql.SQLException: null, message from server: “Host ‘xxx’ is not allowed to connect
- 远程mysql_java.sql.SQLException: null, message from server: "Host 'xxx' is not allowed to connect
- java.sql.SQLException: null, message from server: “Host ‘xxx’ is not allowed to connect异常解决
- java.sql.SQLException: null, message from server: "Host 'xxx' is not allowed to connect to this MySQL server"
- java.sql.SQLException: null, message from server: "Host 'xxx' is not allowed to connect
- 远程mysql_java.sql.SQLException: null, message from server: "Host 'xxx' is not allowed to connect
- java.sql.SQLException: null, message from server: “Host ‘xxx’ is not allowed to connect
- java.sql.SQLException: null, message from server: “Host ‘xxx’ is not allowed to connect
- null, message from server: "Host ***" is not allowed to connect to this MySQL server"
- Mysql报错java.sql.SQLException:null,message from server:"Host '27,45,38,132' is not allowed to connect