MySQL [Warning] IP address could not be resolved

Solution 1:

IMHO This sounds like you need mysqld to stop using DNS.

Please do the following: Add this to /etc/my.cnf

[mysqld]
skip-host-cache
skip-name-resolve

Them restart mysql. From then on, mysql will no longer resolve addresses via DNS.

Give it a Try !!!

CAVEAT

Please read these options in the MySQL Documentation:

  • skip-host-cache
  • skip-name-resolve
  • DNS Lookup Optimization and the Host Cache

Also, there is one restriction to using this: You cannot use DNS names in the host column of any of the grant tables.

UPDATE 2012-12-17 08:37 EDT

I was recently asked if skip-host-cache and skip-name-resolve could be set without a mysql restart. Let's find out:

mysql> show variables like '%host%';
+---------------+--------------+
| Variable_name | Value        |
+---------------+--------------+
| hostname      | ************ |
| report_host   |              |
+---------------+--------------+
2 rows in set (0.00 sec)

mysql> show variables like 'skip_%';
+-----------------------+-------+
| Variable_name         | Value |
+-----------------------+-------+
| skip_external_locking | ON    |
| skip_name_resolve     | OFF   |
| skip_networking       | OFF   |
| skip_show_database    | OFF   |
+-----------------------+-------+
4 rows in set (0.00 sec)

mysql> set global skip_name_resolve = 1;
ERROR 1238 (HY000): Variable 'skip_name_resolve' is a read only variable
mysql>

As shown, skip-host-cache is not visible in the list of global variables. As for skip_name_resolve, it was visible. However, it cannot changed dynamically because it is a read-only variable.

Therefore, skip-host-cache and skip-name-resolve can only be changed via a mysql restart.