KingAndrew
KingAndrew

Reputation: 1165

Error 1794 loading mysql 5.6 master dump while configuring replication slave

E:>mysql -u root < masterDump.db ERROR 1794 (HY000) at line 22: 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. There was no additional messages in the error log.

In their respective my.ini files (Yes, I'm on Windows) The master server-id=1 The slave server-id=2

When I open the dump file and look at line 22 this is what I have (X's inserted for privacy): CHANGE MASTER TO MASTER_HOST='1X2.21.42.XXX', MASTER_PORT=3306, MASTER_USER='replicant', MASTER_PASSWORD='MasteAccessXXX', MASTER_LOG_FILE='mysql-bin.000004', MASTER_LOG_POS=335723162; Clearly I don't have --server-id on that line but it is not part of the "CHANGE MASTER TO" command (http://dev.mysql.com/doc/refman/5.6/en/change-master-to.html)

I started the slave like it said:

mysqld --skip-slave-start

Does anyone have an idea what I am missing?

Thanks,

Andrew

Upvotes: 5

Views: 12237

Answers (4)

user5010266
user5010266

Reputation: 11

If the server-id is right, you should drop some tabel or delete some files;

1,delete file:
  /data/mysql/mysql(its my pwd, you should write yours)
  innodb_index_stats.ibd
  innodb_table_stats.ibd
  slave_master_info.ibd
  slave_relay_log_info.ibd
  slave_worker_info.ibd

or  
mysql -uroot -pXXXX

drop table innodb_index_stats;
drop table innodb_table_stats;
drop table slave_master_info;
drop table slave_relay_log_info;
drop table slave_worker_info;

2,  service  mysqld restart

Upvotes: 0

Siddhartha
Siddhartha

Reputation: 4464

Ran into the same problem. The logs at /var/log/mysql hadn't logged anything either. Ended up unzipping the sql.gz file:

gunzip mysql.sql.gz

and then logging in as root:

mysql -u root -p

and sourcing the file.

Upvotes: 0

KingAndrew
KingAndrew

Reputation: 1165

Ok I figured it out.

You must at least set --server-id to enable either a master or a slave. 

I thought that was needed when starting mysql but that is not a flag for that command.

I added --server-id=2 to mysqld startup and the dump file is loading.

Thanks for looking. Hope this helps someone else.

Andrew

Upvotes: 6

Momo1987
Momo1987

Reputation: 544

try this :

  • Stop slave
  • CHANGE MASTER TO MASTER_DELAY = 0, RELAY_LOG_FILE = 'xxxxx-relay-bin.NNNNNN', RELAY_LOG_POS = YYYYYYYY ;
  • Start slave;

Upvotes: 2

Related Questions