Rare BUG in MySQL database -- Can't get hostname for your address, mysqlhostname
When connecting to mysql jdbc
Com. mysql. jdbc. exceptions. jdbc4.MySQLNonTransientConnectionException: Communication link failure, message from server: "Can't get hostname for your address"
Whether it is using jdbc: mysql: // 127.0.0.1: 3306 or jdbc: mysql: // localhost: 3306, this error occurs.
This error indicates that "your address cannot obtain the host name ".Skip-name-resolveParameter, but after this parameter is added, because I am using a windows-installed Service, this error still exists, and finally found a solution in a blog. Http://blog.csdn.net/zzti_erlie/article/details/53227343
For the green version of mysql, you need to open my. ini, add
[Mysqld] skip-name-resolve # ignore the host name to access lower_case_table_names = 1 # ignore the case sensitivity of the database table name
Then restart the service. This solution is indeed effective,However, it is ineffective for mysql to install the service.Now!
For mysql installed on windows service, you need to click MySQL service in service management, right-click to Open Properties