Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am building two mysql machines in master-slave config. Master has:

mysql> create user 'repl'@'' identified by 'mypassword';
mysql> grant replication slave on *.* to 'repl'@'';

So basically anything like should be able to connect but on slave if I try:

shell> mysql -h -urepl -pmypassword

it says:

ERROR 1130 (HY000): Host '' is not allowed to connect to this MySQL server

I think this is happening because is allowed to connect and not I do not want to use IP for connection. How do I make sure that I am able to connect from without putting IPs into picture.

I don't know if this info is required or not but dns lookup and reverse dns lookup is working fine for both master and slave.

share|improve this question
using just is not good enough for you? – Fox Jan 18 '12 at 12:44
look for a typo in your GRANT statement – yarek Jan 18 '12 at 12:55
@Fox nope. I have tried that already. I used three % because of dots I used. – Aditya Patawari Jan 18 '12 at 12:59
@yarek syntax is correct. I have double checked it. – Aditya Patawari Jan 18 '12 at 12:59
up vote 3 down vote accepted

Make sure you don't have skip_name_resolve set in your my.cnf or in your startup options.

share|improve this answer
that was the culprit! – Aditya Patawari Jan 18 '12 at 13:48

Your Answer


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.