mysqlreplicationdatabase-replicationmysql-error-1054mysql-error-1062

Error 'Unknown column 'branch' in 'field list'' on query. Default database: 'db'


I get the following replication error in SHOW SLAVE STATUS \G;

Error 'Unknown column 'branch' in 'field list'' on query. Default database: 'db'. 

The replication also has been stopped due to this.

How can I fix this?


Solution

  • If you check the Last_Errno row the error code of the error that caused replication to stop is 1054 (Unknown column '%s' in '%s'). If you want the MySQL slave to ignore such errors, just open your my.cnf (on Debian and Ubuntu it's /etc/mysql/my.cnf)...

    1. Edit the my.cnf

      vim /etc/mysql/my.cnf

    2. You can skip multiple errors or only 1054

      slave-skip-errors = 1062,1054

    3. Restart MySQL

      /etc/init.d/mysql restart