Drop the mysql.slave_relay_log_info
table on the 5.7 slave. Log out of mysql, run mysql_upgrade -uroot -p -s
to recreate the dropped table. Log back in to mysql instance then stop slave
/ start slave
all should be good.
The problem was when you source dump.sql it somehow changed the table definition in 5.7 hence the error you were getting.
A simple test I tried was on a working 5.6 master to 5.7 slave repl, I dropped the slave_relay_log_info
table on 5.7 and recreated it with 5.6's table structure and got the same error when I started slave replication.
mysql [localhost] {msandbox} ((none)) > use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql [localhost] {msandbox} (mysql) > CREATE TABLE `slave_relay_log_info` (
-> `Number_of_lines` int(10) unsigned NOT NULL COMMENT 'Number of lines in the file or rows in the table. Used to version table definitions.',
-> `Relay_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'The name of the current relay log file.',
-> `Relay_log_pos` bigint(20) unsigned NOT NULL COMMENT 'The relay log position of the last executed event.',
-> `Master_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'The name of the master binary log file from which the events in the relay log file were read.',
-> `Master_log_pos` bigint(20) unsigned NOT NULL COMMENT 'The master log position of the last executed event.',
-> `Sql_delay` int(11) NOT NULL COMMENT 'The number of seconds that the slave must lag behind the master.',
-> `Number_of_workers` int(10) unsigned NOT NULL,
-> `Id` int(10) unsigned NOT NULL COMMENT 'Internal Id that uniquely identifies this record.',
-> PRIMARY KEY (`Id`)
-> ) ENGINE=InnoDB DEFAULT CHARSET=utf8 STATS_PERSISTENT=0 COMMENT='Relay Log Information';
Query OK, 0 rows affected (0.04 sec)
mysql [localhost] {msandbox} (mysql) > start slave;
ERROR 1805 (HY000): Column count of mysql.slave_relay_log_info is wrong. Expected 9, found 8. The table is probably corrupted
EDIT:
You can drop the table with the wrong structure, and recreate it with this:
CREATE TABLE `mysql`.`slave_relay_log_info` (
`Number_of_lines` int(10) unsigned NOT NULL COMMENT 'Number of lines in the file or rows in the table. Used to version table definitions.',
`Relay_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'The name of the current relay log file.',
`Relay_log_pos` bigint(20) unsigned NOT NULL COMMENT 'The relay log position of the last executed event.',
`Master_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'The name of the master binary log file from which the events in the relay log file were read.',
`Master_log_pos` bigint(20) unsigned NOT NULL COMMENT 'The master log position of the last executed event.',
`Sql_delay` int(11) NOT NULL COMMENT 'The number of seconds that the slave must lag behind the master.',
`Number_of_workers` int(10) unsigned NOT NULL,
`Id` int(10) unsigned NOT NULL COMMENT 'Internal Id that uniquely identifies this record.',
`Channel_name` char(64) NOT NULL COMMENT 'The channel on which the slave is connected to a source. Used in Multisource Replication',
PRIMARY KEY (`Channel_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 STATS_PERSISTENT=0 COMMENT='Relay Log Information';