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.

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

mysql> create user 'repl'@'%.%.%.abc.mydomain.com' identified by 'mypassword';
mysql> grant replication slave on *.* to 'repl'@'%.%.%.abc.mydomian.com';

So basically anything like my.sql.slave.abc.mydomian.com should be able to connect but on slave if I try:

shell> mysql -h my.sql.master.abc.mydomain.com -urepl -pmypassword

it says:

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

I think this is happening because %.%.%.abc.mydomian.com is allowed to connect and not 10.10.2.231. I do not want to use IP for connection. How do I make sure that I am able to connect from my.sql.slave.abc.mydomian.com 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 %.abc.mydomain.com 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
add comment

1 Answer

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. http://dev.mysql.com/doc/refman/5.0/en/server-options.html#option_mysqld_skip-name-resolve

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

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.