欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  数据库

MySQL ERROR解决及MySQL配置说明

程序员文章站 2024-02-17 23:02:58
...

1.MySQL ERROR 1042 (HY000): Cant get hostname for your address 远程无法连接MySQL了,提示错误如下: ERROR 1042 (HY000): Can't get hostname for your ad[root@localhost ~]# mysql -h 192.168.1.10 -u root -pEnter password:ERROR 1042 (HY000): Can

1.MySQL ERROR 1042 (HY000): Can’t get hostname for your address

远程无法连接MySQL了,提示错误如下:

ERROR 1042 (HY000): Can't get hostname for your ad
[root@localhost ~]# mysql -h 192.168.1.10 -u root -p
Enter password:
ERROR 1042 (HY000): Can't get hostname for your address

//解决办法:添加配置文件

在配置文件/etc/my.cnf中插入以下语句。
[mysqld]
skip-name-resolve