How to limit number of connections to one database on MySQL

旧时模样 提交于 2019-12-11 18:25:50

问题


I am search in MySQL user connection limit in particular database, we got option user connection limit in overall database but not find any step which is provide connection limit on particular database level, if any one have some solution please let me know


回答1:


You want to look at the 'account' level limitations:

http://dev.mysql.com/doc/refman/5.0/en/user-resources.html

You should already have a user for that database, and you can then set

MAX_QUERIES_PER_HOUR <number>
MAX_UPDATES_PER_HOUR <number>
MAX_CONNECTIONS_PER_HOUR <number>
MAX_USER_CONNECTIONS <number>

from a GRANT statement. (You dont need all of them, maybe just MAX_USER_CONNECTIONS)




回答2:


log in to your server as root user go to phpmyadmin in variables section you can change

MAX_USER_CONNECTIONS 

to a bigger number



来源:https://stackoverflow.com/questions/25720175/how-to-limit-number-of-connections-to-one-database-on-mysql

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!