set --server-id to enable either a master or a slave

set --server-id to enable either a master or a slave


Below issue can be faced, when we run CHANGE MASTER command to setup replication.
mysql> change master to master_host='xx.xx.xx.xx',master_user='rep_user',master_password="xxxxxxx", master_log_file='db-01-test-bin.000064',master_log_pos=95854072,master_auto_position=0;
ERROR 1794 (HY000): Slave is not configured or failed to initialize properly. You must at least set --server-id to enable either a master or a slave. Additional error messages can be found in the MySQL error log.

Solution :-

Here It is assumed, We have already set server-id parameter value different on master and slave node but still, we have the above error.

It happens once, you performed the server packages upgrade(like from 5.6 to 5.7) and just started MySQL service and going to run CHANGE MASTER command.

So, to solve this issue, Run mysql_upgrade command to update/upgrade system tables and then restart MySQL service.
mysql_upgrade 

service mysql restart

Comments

Popular

SLEEP thread causing "Waiting for table metadata lock"

MySQL Memory Calculator

errno: 24 - Too many open files

How to create CentOS VM using Vagrant

How to properly shutdown MySQL before any maintenance activity

ERROR 1040 (HY000): Too many connections

GTID Replication (Skip Transaction using empty transaction)

Master has purged binary logs containing GTIDs that the slave requires

How to Prepare for MySQL Certification Exam