3

I'm trying to set up replication in MySQL but I am being given an error that I do not know how to fix -

ERROR 1218 (08S01): Error connecting to master: Host 'sh047.mydomain.com' is not allowed to connect to this MySQL server

I've added the following code to the master my.ini -

server-id=238429
log-bin=mysql-bin
log-error=mysql-bin.err
binlog_do_db=my_databases_to_replicate {not literal, have listed the correct databases}

And I've added this to the slave my.ini -

server-id=2
master-host=192.168.1.15
master-user=replication
master-password=my_password
master-connect-retry=60
replicate-do-db=my_databases_to_replicate

The user 'replication' exists and the password that I use in the slave my.ini is correct. Any suggestions as to how to fix this would be welcome.

Thanks.

David Gard
  • 11,225
  • 36
  • 115
  • 227

1 Answers1

1

The error message says it all:

Host 'sh047.mydomain.com' is not allowed to connect to this MySQL server

Make sure the user replication is configurated as replication@sh047.mydomain.com (or, but only for testing purposes: replication@%) on your master database.

If this doesn't work out, check the MySQL Documentation for this, there might be one or two special cases (Linux compilation etc.), where that error might occur, too.

Bjoern
  • 15,934
  • 4
  • 43
  • 48
  • Always the simple answers! I'd added 'replication'@'localhost' only, didn't even think to look there! Thanks. – David Gard Nov 22 '11 at 10:21
  • 2
    Np, you're welcome. I had a similar issue this week, that was why it was still fresh in my memory! – Bjoern Nov 22 '11 at 10:42
  • I think about what happen when DNS service fall down or became slow. I prefer disable DNS reverse lookup (in my.cnf) and use static IP address for replication. – Moshe L Nov 22 '11 at 13:23