MySQL 一个数据库的最大大小是多少?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10436246/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
MySQL what is the maximum size of a database?
提问by stackoverflow
I have looked all over the MySQL website and found no definitive answers.
我已经查看了 MySQL 网站,但没有找到明确的答案。
- Is the size of the database determined by the operating system or is there 4GB limit?
- Where can I find perforamnce statistics against other databases (sqlServer, oracle ect)
- 数据库的大小是由操作系统决定的还是有4GB的限制?
- 我在哪里可以找到针对其他数据库(sqlServer、oracle 等)的性能统计信息
回答by Asaph
According to the MySQL Manual:
根据MySQL 手册:
E.10.3. Limits on Table Size
The effective maximum table size for MySQL databases is usually determined by operating system constraints on file sizes, not by MySQL internal limits. The following table lists some examples of operating system file-size limits. This is only a rough guide and is not intended to be definitive. For the most up-to-date information, be sure to check the documentation specific to your operating system.
E.10.3. 表大小限制
MySQL 数据库的有效最大表大小通常由操作系统对文件大小的限制决定,而不是由 MySQL 内部限制决定。下表列出了操作系统文件大小限制的一些示例。这只是一个粗略的指南,并不是决定性的。有关最新信息,请务必查看特定于您的操作系统的文档。
Operating System File-size Limit
Win32 w/ FAT/FAT32 2GB/4GB
Win32 w/ NTFS 2TB (possibly larger)
Linux 2.2-Intel 32-bit 2GB (LFS: 4GB)
Linux 2.4+ (using ext3 file system) 4TB
Solaris 9/10 16TB
MacOS X w/ HFS+ 2TB
Windows users, please note that FAT and VFAT (FAT32) are not considered suitable for production use with MySQL. Use NTFS instead.
On Linux 2.2, you can get MyISAM tables larger than 2GB in size by using the Large File Support (LFS) patch for the ext2 file system. Most current Linux distributions are based on kernel 2.4 or higher and include all the required LFS patches. On Linux 2.4, patches also exist for ReiserFS to get support for big files (up to 2TB). With JFS and XFS, petabyte and larger files are possible on Linux.
Windows 用户,请注意 FAT 和 VFAT (FAT32) 不适合用于 MySQL 的生产用途。请改用 NTFS。
在 Linux 2.2 上,您可以通过使用 ext2 文件系统的大文件支持 (LFS) 补丁来获得大小超过 2GB 的 MyISAM 表。大多数当前的 Linux 发行版都基于内核 2.4 或更高版本,并包含所有必需的 LFS 补丁。在 Linux 2.4 上,还存在 ReiserFS 补丁以获得对大文件(高达 2TB)的支持。使用 JFS 和 XFS,在 Linux 上可以实现 PB 和更大的文件。
As for the other part of your question, a few thoughts:
至于你问题的另一部分,有几点想法:
- It's a broad, complex, multi-factorial question. Consider narrowing the scope of the question to MySQL and one other RDBMS (eg. SQL Server) and probably even one particular feature.
- Google is your friend.
- Vendors tend to publish their own biased comparisons. Take vendor numbers with a grain of salt.
- 这是一个广泛、复杂、多因素的问题。考虑将问题的范围缩小到 MySQL 和其他 RDBMS(例如 SQL Server),甚至可能是一项特定功能。
- 谷歌是你的朋友。
- 供应商倾向于发布他们自己有偏见的比较。对供应商编号持保留态度。
回答by Habib
1- With respect to database size, the limit is dependent on Operating System file size. Please see this article
2- The effective maximum table size for MySQL databases is usually determined by operating system constraints on file sizes, not by MySQL internal limits. (Source)
3- You may google for MySQL vs SQL Server Vs Oracle, also check this link
1- 关于数据库大小,限制取决于操作系统文件大小。请参阅这篇文章
2- MySQL 数据库的有效最大表大小通常由操作系统对文件大小的限制决定,而不是由 MySQL 内部限制决定。(来源)
3- 您可以在 google 上搜索 MySQL vs SQL Server Vs Oracle,也可以查看此链接
回答by Valters Boze
default mysql is 256 TB for myd file with 6 byte pointer size. i know this is ridiculous answer, but that is what you wanted to know. in real life all depends on the queries, indexes, column count, row count, etc.. i guess.
对于 6 字节指针大小的 myd 文件,默认 mysql 为 256 TB。我知道这是一个荒谬的答案,但这就是你想知道的。在现实生活中,一切都取决于查询、索引、列数、行数等。我猜。
回答by Rick James
With today's hardware and OS, together with MySQL's preferred Engine InnoDB, the tablesize limitation is 64TB. With PARTITIONing, that can be stretched to over a hundred petabytes.
以今天的硬件和操作系统,再加上 MySQL 的首选引擎 InnoDB,表大小限制为 64TB。使用PARTITIONing,这可以扩展到一百多 PB。
A databaseis a collection of tables. So, to answer the title question literally, we need to go beyond the max table size. Since there can be thousands of tables in a database, we are now into the exabyte stratosphere.
一个数据库是集合表。因此,要从字面上回答标题问题,我们需要超出最大表大小。由于数据库中可能有数千个表,我们现在进入了 EB 级别。
See also Hard limits in MySQL.
另请参阅MySQL 中的硬限制。

