简体   繁体   English

如何在python环境中设置最大用户连接数?

[英]How to set max user connections in python environment?

Currently I am working on a bot using mysql connector , which is python library that allows you to communicate with mysql.目前我正在使用mysql connector开发一个机器人,它是一个允许你与 mysql 通信的 python 库。 I am running ClearDB on Heroku .我在Heroku上运行ClearDB
Sometimes while I am running certain commands I run into the following error.有时,当我运行某些命令时,会遇到以下错误。

Error Code: 1226 User 'b450a27c71705e' has exceeded the 'max_user_connections' resource (current value: 10)错误代码:1226 用户“b450a27c71705e”已超过“max_user_connections”资源(当前值:10)

While this error hasn't seemed to stop any of my commands from running , i'd rather change the allowed amount of user connections before it does.虽然这个错误似乎并没有阻止我的任何命令运行,但我宁愿在它发生之前更改允许的用户连接数量。
Unfortunately , the only answers I can find are for PHP , which is ,不幸的是,我能找到的唯一答案是针对 PHP 的,即,

SET GLOBAL max_user_connections = 100;

Any idea how to replicate this in python?知道如何在 python 中复制它吗?

You are using a ClearDB plan that only permits 10 connections.您正在使用仅允许 10 个连接的 ClearDB 计划。 The only path they offer is to upgrade to a ClearDB plan that offers more connections.他们提供的唯一途径是升级到提供更多连接的 ClearDB 计划。 If you're on Mercury, upgrade to Jupiter or Saturn.如果你在水星,升级到木星或土星。 If in doubt, post your question to the ClearDB Support system.如果有疑问,请将您的问题发布到 ClearDB 支持系统。 They will be able to help you best.他们将能够为您提供最好的帮助。

The multi-tenant systems will not permit you to modify this parameter.多租户系统不允许您修改此参数。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM