AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 509117
Accepted
nulltek
nulltek
Asked: 2013-05-20 14:34:49 +0800 CST2013-05-20 14:34:49 +0800 CST 2013-05-20 14:34:49 +0800 CST

Innodb 每个表空间一个文件

  • 772

我正走进一个使用 MySQL 和 Innodb 作为存储引擎的环境。我想启用 innodb_file_per_table 来提高性能。考虑到所有数据库/表当前都存储在 ibdata1/default ibdata 文件中,innodb_file_per_table 选项是否只影响我设置此指令后创建的新表?

使用现有数据库并将每个表拆分为它自己的 ibd 文件的最佳方法是什么?我是否必须转储/恢复所有表才能实现这一点?

mysql
  • 2 2 个回答
  • 1030 Views

2 个回答

  • Voted
  1. RolandoMySQLDBA
    2013-05-21T09:00:03+08:002013-05-21T09:00:03+08:00

    我同意@faker 的回答和评论(他的回答+1),但还有一件重要的事情要做:

    在关闭 mysql 之前,您需要运行SET GLOBAL innodb_fast_shutdown = 0;. 为什么?

    这将完全清除 ib_logfile0 和 ib_logfile1 中遗留的所有事务信息。关闭时间更长,但在未提交的事务数据方面没有任何逗留。因此,执行此过程不会丢失任何数据。

    这是我在 StackOverflow 中的帖子:如何操作:https ://stackoverflow.com/a/4056261/491757

    • 2
  2. Best Answer
    faker
    2013-05-20T14:53:51+08:002013-05-20T14:53:51+08:00

    http://dev.mysql.com/doc/refman/5.0/en/innodb-multiple-tablespaces.html:

    The --innodb_file_per_table option affects only table creation, not access to 
    existing tables. If you start the server with this option, new tables are 
    created using .ibd  files, but you can still access tables that exist in the 
    shared tablespace. If you start the server without this option, new tables are 
    created in the shared tablespace, but you can still access any tables that were
    created using multiple tablespaces.
    

    是的,需要转储和恢复才能将现有表移动到它们自己的文件中。

    • 1

相关问题

  • 开源与专有关系 db mgt 系统的优缺点是什么?

  • 在 solaris 10 上为 mysql 设置 max_allowed_pa​​cket

  • 如何移动 MySQL 的数据目录?

  • 通过 VPN 连接什么是远程服务器 IP?

  • mysql崩溃

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve