5

I'm trying to enable binary logging so that I can set up master-slave replication between two servers. I'm working with an existing server with lots of data and I'm trying to dump the data with the following command:

mysqldump -u root -p --all-databases --master-data > masterdump.sql

but I get the error: mysqldump: Error: Binlogging on server not active.

I've followed all sorts of tutorials on how to enable binary logging, but nothing has worked. I've made sure that I've added the following parameters to my.cnf:

server-id    = 1
log_bin      = /var/log/mysql/mysql-bin.log
sync_binlog  = 1

When I restart MySQL, it takes a while (I assume it's due to the huge size of the database), about 60 seconds, but eventually starts. However, when I check /var/log/mysql/error.log, I find the following error (duplicated hundreds of times):

InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process

So I went looking for all the mysqld processes by running pstree and I found the following:

root@my_server:~# pstree
init---some stuff
     |--
     |--mysqld---10*[{mysqld}]
     |--
     |--sudo---mysqld---23*[{mysqld}]

This is where I'm stuck. I don't know whether it's normal to have mysqld AND sudo mysqld both running. The server is being maintained by ServerPilot, which [I think] installed MySQL for me.

Does any of this evidence point to any sort of reason why Binary Logging won't enable?

Justin
  • 151
  • 1
  • 6

1 Answers1

0

It looks like the multiple mysqld processes were causing problems. Thanks to some tips from this question I was able to kill the process tree under sudo mysqld and Binary logging started right away. Getting the rest of master-slave replication working was pretty quick after that, thanks to this awesome tutorial.

Justin
  • 151
  • 1
  • 6