Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Suddenly today, I had an issue with connections to mysql hanging when connecting by IP address (e.g. mysql -h 10.1.248.20), but I could still connection using localhost fine, regardless the user.

mysql> show processlist;
+----+----------------------+------------------+------+---------+------+-----------------------------------------------------------------------+------------------+
| Id | User                 | Host             | db   | Command | Time | State                                                                 | Info             |
+----+----------------------+------------------+------+---------+------+-----------------------------------------------------------------------+------------------+
|  1 | system user          |                  | NULL | Connect |   10 | Connecting to master                                                  | NULL             |
|  2 | system user          |                  | NULL | Connect |   10 | Has read all relay log; waiting for the slave I/O thread to update it | NULL             |
| 37 | unauthenticated user | 10.1.248.3:36694 | NULL | Connect | NULL | login                                                                 | NULL             |
| 38 | unauthenticated user | 10.1.248.3:36695 | NULL | Connect | NULL | login                                                                 | NULL             |
| 39 | unauthenticated user | 10.1.248.3:36696 | NULL | Connect | NULL | login                                                                 | NULL             |
| 40 | root                 | localhost        | NULL | Query   |    0 | NULL                                                                  | show processlist |
+----+----------------------+------------------+------+---------+------+-----------------------------------------------------------------------+------------------+
6 rows in set (0.00 sec)

Yes, I realize replication was broken in that output above; that was after I tried restart MySQL (it was an emergency).

And as suddenly as things stopped working, they started working again.

DNS was working fine at the time. Replication was still working. MySQL was responsive.

Does anyone have any idea what would cause MySQL logins from remote IPs to hang suddenly?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

Try to add skip-name-resolve to [mysqld] section of /etc/my.cnf like this:

[mysqld]
skip-name-resolve

Seems to be a name resolving issue.

share|improve this answer
    
I'll add that and hope it prevents it from happening again in the future! –  Mark Rose Feb 4 '11 at 23:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.