java.sql.SQLException: null, message from server: "Host '172.17.0.9' is not allowed to connect to this MySQL server"


Samebug tips1

MySQL doesn't support some types of characters (such as emojis) with the utf8 encoding. You need to be on MySQL 5.5+ and force utf8mb4 (everywhere, client and server). You can do this sending the query "SET NAMES utf8mb4". Check this https://goo.gl/3E2qzg


7 months ago
Expert tip

Solutions on the web652

Solution icon of stackoverflow
null, message from server: "Host '172.17.0.9' is not allowed to connect to this MySQL server"

Solution icon of stackoverflow
null, message from server: "Host '192.168.1.100' is not allowed to connect to this MySQL server"

Solution icon of stackoverflow
null, message from server: "Host 'xxx.fuchs.com' is not allowed to connect to this MySQL server"

Solution icon of stackoverflow
via Stack Overflow by Ravi H Tapela
, 1 year ago
null, message from server: "Host 'ravi' is not allowed to connect to this MySQL server"

Solution icon of stackoverflow
null, message from server: "Host 'PC008' is not allowed to connect to this MySQL server"

Solution icon of web
via mysql.com by Unknown author, 1 year ago
null, message from server: "Host 'testclient.testcompany.com' is not allowed to connect to this MySQL server"

Solution icon of github
via GitHub by xiuleid
, 3 months ago
null, message from server: "Host '10.138.125.19' is not allowed to connect to this MySQL server"

Solution icon of stackoverflow
null, message from server: "Host '172.23.251.154' is not allowed to connect to this MySQL server"

Solution icon of stackoverflow
null, message from server: "Host '103.253.39.4' is not allowed to connect to this MySQL server"

Solution icon of stackoverflow
via Stack Overflow by prolink007
, 6 months ago
null, message from server: "Host '192.168.1.102' is not allowed to connect to this MySQL server"

Stack trace

java.sql.SQLException: null,  message from server: "Host '172.17.0.9' is not allowed to connect to this MySQL server"
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:959)
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:898)
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:887)
	at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1038)
	at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2254)
	at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2285)
	at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2084)
	at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:795)
	at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:44)

Write tip

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

Users with the same issue

Samebug visitor profile picture
Unknown user
Once, 1 year ago
2 times, 3 days ago
4 times, 5 days ago
115 times, 1 week ago
Once, 2 weeks ago
160 more bugmates