I've been setting up MySQL master replication (on Debian 6.0.1) following these instructions faithfully: http://www.neocodesoftware.com/replication/
I've got as far as:
mysql > show master status;
but this is unfortunately producing the following, rather than any useful output:
Empty set (0.00 sec)
The error log at /var/log/mysql.err
is just an empty file, so that's not giving me any clues.
Any ideas?
This is what I have put in /etc/mysql/my.cnf
on one server (amended appropriately for the other server):
server-id = 1
replicate-same-server-id = 0
auto-increment-increment = 2
auto-increment-offset = 1
master-host = 10.0.0.3
master-user = <myusername>
master-password = <mypass>
master-connect-retry = 60
replicate-do-db = fruit
log-bin = /var/log/mysql-replication.log
binlog-do-db = fruit
And I have set up users and can connect from MySQL on Server A to the database on Server B using the username/password/ipaddress above.
Interestingly, I have mysql running on my PC with binary logs not enabled. I did the following:
As shown, since MySQL shows "Empty Set" for SHOW MASTER STATUS; because binary logging was not enabled. That's obvious given the configuration I have.
First thing you should do is make sure the error log has a specific folder
Then run the following:
Then in the mysql client run these SQL Commands
If you get the same output I had before, then MySQL cannot write binary logs to the designated folder. Your dilemma becomes why MySQL cannot write to /var/log.
This is not a full answer but I hope this helps.
If thhe Mysql version is >5.0, your replication settings master-host, master-user, master-password and a few others in your my.cnf will be ignored. Use CHANGE MASTER TO for initial replication setup.
Compare http://dev.mysql.com/doc/refman/5.1/en/replication-howto-slaveinit.html
Your setting for
log-bin
is incorrect, so MySQL can't write binary logs. It isn't a filename, it is a partial filename pattern, to which MySQL will prepend a directory and append a sequence number and extension. The usual setting is something likeCheck the manual.
If you are using Amazon RDS or Aurora, remember to reboot the writer instance after applying
bin_log
in cluster parameter.This needs to be done manually. Rebooting writer instance will also cause read replicas to reboot.
Before rebooting you will get
Empty set
.