【发布时间】:2018-05-12 01:33:07
【问题描述】:
我在使用 ClearDB mySQL 的 Heroku 上的 Rails 站点中始终遇到此错误。
Mysql2::Error: User '123123' has exceeded the 'max_questions' resource
(current value: 18000)
查看日志,对于正常的 ActiveRecord 查找返回异常。其中一个例外是抱怨模型关注点中的范围。
ActiveRecord::StatementInvalid: Mysql2::Error: User '123123'
has exceeded the 'max_questions' resource (current value: 36000): SET
@@SESSION.sql_mode = CONCAT(CONCAT(@@sql_mode, ',STRICT_ALL_TABLES'),
',NO_AUTO_VALUE_ON_ZERO'), @@SESSION.sql_auto_is_null = 0,
@@SESSION.wait_timeout = 2147483
我在Punch plan 上。该网站根本没有获得太多流量。每天约100次访问。为了避免这个错误,我在 Rails 或 Heroku 中是否有一些配置不正确?
更新:移至更高的下一个计划,但仍然出现这些异常。
【问题讨论】:
-
更新 2:我最终将 ClearDB 迁移到 Heroku 的 Postgres,从而解决了问题。该站点不再收到 max_questions 资源错误异常。当我弄清楚为什么我会分享。我使用gist.github.com/tristanm/a2afa29ac6f37bf92b46 作为参考。
标签: mysql ruby-on-rails heroku cleardb