gpt4 book ai didi

mysql - 表在系统表空间 0 中,不能丢弃

转载 作者:可可西里 更新时间:2023-11-01 08:48:41 27 4
gpt4 key购买 nike

我正在尝试运行此查询:

alter table about_member discard tablespace;

但是当我这样做时,我的错误日志输出如下:

InnoDB: Error: table `diskise`.`about_member`
InnoDB: is in the system tablespace 0 which cannot be discarded

我该怎么做才能丢弃这个表空间,以便导入我拥有的备份?

最佳答案

参见 this manual page :

By default, all InnoDB tables and indexes are stored in the system tablespace. As an alternative, you can store each InnoDB table and its indexes in its own file. This feature is called “multiple tablespaces” because each table that is created when this setting is in effect has its own tablespace.

Advantages of Per-Table Tablespaces

You can reclaim disk space when truncating or dropping a table. For tables created when file-per-table mode is turned off, truncating or dropping them creates free space internally in the ibdata files. That free space can only be used for new InnoDB data.

听起来您在默认表空间中创建了表,因此您不能丢弃该表空间。也就是说,您应该能够在不首先丢弃表空间的情况下导入数据,除非您的磁盘空间不足。

关于mysql - 表在系统表空间 0 中,不能丢弃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20208476/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com