背景
其他库向mysql迁移时,中间迁移过程出现报错,如:表创建失败
问题
该IP下连接数据库报错(其他机器可以正常连接),或程序中报错。
host ‘192.168.xx.xx’ is blocked because of many connection errors;unblock with ‘mysqladmin flush-hosts’
原因
一般是 max_connect_errors = 10 报错 ,要调高错误连接的数量
处理
找一台可以正常连接的机器,查看错误连接数,重新设置,刷新
mysql> show variables like 'max_connect_errors';
mysql> set global max_connect_errors = 1000; # 如果想长期生效,并修改my.cnf配置文件
mysql> flush hosts;
如果不更改错误连接数, flush hosts; 也是可以的