是否可以限制单个 mysql 表的大小(以磁盘大小/行为单位)?
如果不可能,在一台物理计算机上运行多个 mysql 引擎的最简单方法是什么?(我的计划是将一个mysql实例的数据文件设置到一个单独的磁盘分区)。
这与问题 #1561612非常相似,除了每个模式都强制执行限制。不幸的是,没有真正得到很好支持的方法来做到这一点。请在那里查看答案,看看他们是否也回答了您的问题。
至少,您需要将这些从用户更改为用户:
[mysqld]
port=PORT_NUMBER
datadir=/home/USER/mysql
tmpdir=/home/USER/tmp/mysql
要启动服务器,请运行:
mysqld_safe --defaults-file=user_specific_my.cnf
要停止服务器,请运行:
mysqladmin -u root -pROOT_PASSWORD --port=3307 -h 127.0.0.1 shutdown
要连接到服务器,用户应该使用:
mysql --port=USER_PORT -h 127.0.0.1 -pPASSWORD
您可以使用创建压缩表的 myisampack 实用程序(但仅适用于 MyISAM 引擎)。表变成只读的静态数据类型。
To enforce quotas there are a few different approaches I think the one found on this site is probably the most sound I've run across.
To direct mysql to different data directories either put symlinks in your linux setup or try using a configuration file. MySQL will let you specify where the database files are saved via these conf files read here for windows setup or search around for information about my.cnf
Best of luck to you its late so I'm off to bed.
如果它们是 MyISAM 表,则 toy 可以指定存储数据和索引文件的目录。
根据用户界面:
Data Directory: ___________________ Directory where to put the tables data file
Index Directory: __________________ Directory where to put the tables index file
This works only for MyISAM tables and not on some operating systems (Windows)
所以我想这意味着如果您不在 Windows 主机上,您可以移动表格的文件。