解决MySQL:1042错误-Can't get hostname for your address

MySQL错误1042-Can't get hostname for your address

解决办法:

需要修改配置文件,在[mysqld]下增加skip-name-resolve(忽略主机名的方式访问),并重启MYSQL服务可解决此问题。

例如:MYSQL配置文件在: /etc/my.cnf,

    编辑它,在[mysqld]下增加skip-name-resolve,在执行service mysql restart 即可。

你可能感兴趣的:(解决MySQL:1042错误-Can't get hostname for your address)