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?