I have a an ubuntu we server running mysql 5.1. Previously I had this server set up as a slave for replication. Now I and switching rolls for this server and I do not need it to be a slave anymore. The problem is that right now, every time the mysql is restarted, it starts into slave mode, and when I run commands like this:
mysql < mysql_dump_file.sql
I get this error:
ERROR 1198 (HY000) at line 22: This operation cannot be performed with a running slave; run STOP SLAVE first
Of course I can run the stop slave; command in mysql and it fixes the issue, but when I restart the server the problem comes back.
Previously for the slave configuration, I had added the following lines in the my.cnf file:
port=3306
log-bin
server-id=2
master-host=(ip of master)
master-user=repl
master-password=slavepass
master-port=3306
replicate_do_db=(db to replicate)
Now I have removed all these lines and restarted, and the db automatically starts into slave mode still. I am trying to configure the mysql so that it will NOT start up in slave mode. What am I missing?
Thanks!
You can use RESET SLAVE to restart slave from start or to stop the replication just remove master.info and relay-log.info files manually.
It deletes the master.info and relay-log.info files, all the relay log files, and starts a new relay log file.