CommunicationsException: Communications link failu
2015-12-18 10:34
441 查看
So, you have a
I'm quoting from this answer which also contains a step-by-step MySQL+JDBC tutorial:
If you get a SQLException: Connection refused or Connection timed out or a MySQL specific CommunicationsException: Communications link failure, then it means that the DB isn't reachable at all. This can have one or more of the following causes:
IP address or hostname in JDBC URL is wrong.
Hostname in JDBC URL is not recognized by local DNS server.
Port number is missing or wrong in JDBC URL.
DB server is down.
DB server doesn't accept TCP/IP connections.
DB server has run out of connections.
Something in between Java and DB is blocking connections, e.g. a firewall or proxy.
To solve the one or the other, follow the following advices:
Verify and test them with ping.
Refresh DNS or use IP address in JDBC URL instead.
Verify it based on my.cnf of MySQL DB.
Start the DB.
Verify if mysqld is started without the --skip-networking option.
Restart the DB and fix your code accordingly that it closes connections in finally.
Disable firewall and/or configure firewall/proxy to allow/forward the port.
CommunicationsException: Communications link failure
I'm quoting from this answer which also contains a step-by-step MySQL+JDBC tutorial:
If you get a SQLException: Connection refused or Connection timed out or a MySQL specific CommunicationsException: Communications link failure, then it means that the DB isn't reachable at all. This can have one or more of the following causes:
IP address or hostname in JDBC URL is wrong.
Hostname in JDBC URL is not recognized by local DNS server.
Port number is missing or wrong in JDBC URL.
DB server is down.
DB server doesn't accept TCP/IP connections.
DB server has run out of connections.
Something in between Java and DB is blocking connections, e.g. a firewall or proxy.
To solve the one or the other, follow the following advices:
Verify and test them with ping.
Refresh DNS or use IP address in JDBC URL instead.
Verify it based on my.cnf of MySQL DB.
Start the DB.
Verify if mysqld is started without the --skip-networking option.
Restart the DB and fix your code accordingly that it closes connections in finally.
Disable firewall and/or configure firewall/proxy to allow/forward the port.
相关文章推荐
- Codeforce----Sorting Railway Cars
- Daily Scrum 12.18
- Cleanup failed to process the following paths错误的解决
- Cleanup failed to process the following paths错误的解决
- Regex Failure - Bug Fixing #2
- 与时代接轨——普实ERP系统【AIO5】终身免费
- Choosing Symbol Pairs
- Training Very Deep Networks--Highway Networks
- NSLayoutConstraint---AutoLayout的三种设置方式之—
- UVALive 6900 Road Repair(点分治)
- Daily Scrumming* 2015.12.17(Day 9)
- Installation error INSTALL_FAILED_VERSION_DOWNGRADE错误
- 【leetcode题解】【再看一遍】【86】【M】Contains Duplicate III
- kaldi increasing GMM components in the training procedure
- 报错: Domain=NSCocoaErrorDomain Code=3000 "未找到应用程序的“aps-environment”的权利字符串"
- 人工智能(AI)之朴素贝叶斯(NB)的基本实现
- 人工智能(AI)之KNN的基本实现
- Failed to import pydot 和graphviz error: (2, 'RegOpenKeyEx',错误总结
- CF 335 div.2-C/div.1-A/605A Sorting Railway Cars
- struct的初始化及其构造函数 http://blog.csdn.net/niuox/article/details/7253374