本文介绍了MySQL架构大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有多个用户的开发MySQL服务器(仅InnoDB).每个用户都可以访问一个排他的架构.如何限制架构大小,以便每个用户只能使用1GB(例如)?

I have a development MySQL (InnoDB only) server with several users. Each user has access on one exclusive schema. How can I limit the schema size so that each user can use only 1GB (for example)?

推荐答案

MySQL本身不提供配额系统.使用James McNellis建议的方法可能会起作用,但是让InnoDB突然达到硬配额限制肯定不会对稳定性有所帮助.所有数据文件仍通过无法删除的系统表空间进行连接.

MySQL itself does not offer a quota system. Using the method suggested by James McNellis would probably work, however having InnoDB reach a hard quota limit suddenly would certainly not benefit stability; all data files are still connected via the system table space which cannot get rid of.

不幸的是,我看不到实现您想要的目标的实用方法.如果您担心磁盘空间使用量超出预定义的限制,并且不想采用外部配额规定的方法,则建议保留组合表空间设置(即否innodb_file_per_table),并从配置中删除:autoextend.

Unfortunately I do not see a practical way to achieve what you want. If you are concerned about disk space usage exceeding predefined limits and do not want to go the way of external quota regulations, I suggest staying with the combined table space settings (i. e. no innodb_file_per_table) and remove the :autoextend from the configuration.

那样,您仍然不会获得特定于用户或架构的限制,但至少可以防止磁盘上的数据被填满,因为在此设置中表空间不会超过其初始大小.不幸的是,使用innodb_file_per_table时,无法将它们中的每个配置为以某个最大大小停止.

That way you still will not get user or schema specific limits, but at least prevent the disk from being filled up with data, because the table space will not grow past its initial size in this setup. With innodb_file_per_table there unfortunately is no way to configure each of them to stop at a certain maximum size.

这是MySQL与其他据称是企业级数据库不同的方面之一.不过请不要误会,我们在数千个安装中使用InnoDB来处理大量数据,因此,事实证明它已经可以用于生产级.有时仅缺少管理功能.

This is one of the aspects MySQL differs from other, supposedly more enterprise-level databases. Don't get me wrong though, we use InnoDB with lots of data in several thousand installations, so it has certainly proven to be ready for production grade. Only the management features are a little lacking at times.

这篇关于MySQL架构大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-31 12:37