【踩坑】通过ORM操作MySQL时报错

前言

通过ORM操作MySQL时报错:Host '127.0.0.1' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'

原因

  • MySQL错误连接过多

解决问题

  • 刷新错误
1
FLUSH HOSTS;
  • 修改配置,调整错误连接数上限
/etc/my.cnf
1
2
[mysqld]
max_connect_errors = 10000

完成