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 :-

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.

service mysql restart



How to properly shutdown MySQL before any maintenance activity

How to Prepare for MySQL Certification Exam

errno: 24 - Too many open files

MySQL 8.0 : Error Logging

Install MySQL on CentOS using DBdeployer