create connection SQLException, url: XXXX errorCode 0 ,state 08001
短信预约 -IT技能 免费直播动态提醒
create connection SQLException, url: XXXXXX, errorCode 0, state 08001
关于这个问题 百度了两个多小时 网上众说纷纭但是一个顶用的都没有,首先关注点并不在这里 而是在如下
2022-12-18 01:30:56.022 ERROR 57546 --- [eate-1740826931] com.alibaba.druid.pool.DruidDataSource : create connection SQLException, url: XXXXXXXXXX, errorCode 0, state 08001java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up. at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:110) at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97) at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:89) at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:63) at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:73) at com.mysql.cj.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:898) at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:823) at com.mysql.cj.jdbc.ConnectionImpl.(ConnectionImpl.java:448) at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:241) at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:198) at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1651) at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1717) at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:2785)Caused by: com.mysql.cj.exceptions.CJException: null, message from server: "Host 'XXXXXX' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'"
Caused by: com.mysql.cj.exceptions.CJException: null, message from server: “Host ‘XXXXXX’ is blocked because of many connection errors; unblock with ‘mysqladmin flush-hosts’”
主要问题是这行 意思呢大概就是连接错误次数达到上限 所以被mysql把错误上限得到IP拉黑了
找到问题的原因了 接下来就好解决了 解决问题的办法也就在问题的结尾
我们到服务器连接上Mysql 然后执行
flush hosts;
再次启动项目 连接正常搞定
来源地址:https://blog.csdn.net/weixin_42436477/article/details/128359247
免责声明:
① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。
② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341