场景:MYSQL5.5 小版本升级
导出老版本数据后在操作数据库时提示下面错误
#1547 - Column count of mysql.user is wrong. Expected 42, found 43. The table is probably corrupted
登录mysql命令行查看
show create table mysql.user\G
发现与老版本相比多了
`password_expired` enum('N','Y') COLLATE utf8_bin NOT NULL DEFAULT 'N',
在结构内删除此段
ALTER TABLE `user` DROP `password_expired`;
例如有的版本需要此结构缺少的也会出现问题,直接增加
alter table mysql.user add column <code>password_expired</code> enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N';