2012-11-29 55 views

回答

7

是否有可能为表声明ROW_FORMAT = COMPRESSED,但是您没有启用配置值innodb_file_format = BARRACUDA?

如果你不做后面的步骤,那么梭子鱼行格式的任何请求都不会生效。而这样的请求生成一个警告:

mysql> alter table foo row_format=compressed; 
Query OK, 0 rows affected, 2 warnings (0.03 sec) 
Records: 0 Duplicates: 0 Warnings: 2 

mysql> show warnings; 
+---------+------+-----------------------------------------------------------------------+ 
| Level | Code | Message                | 
+---------+------+-----------------------------------------------------------------------+ 
| Warning | 1478 | InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_format > Antelope. | 
| Warning | 1478 | InnoDB: assuming ROW_FORMAT=COMPACT.         | 
+---------+------+-----------------------------------------------------------------------+ 

此外,您不能使用压缩的行格式,除非您还启用innodb_file_per_table

mysql> alter table foo row_format=compressed; 
Query OK, 0 rows affected, 2 warnings (0.03 sec) 
Records: 0 Duplicates: 0 Warnings: 2 

mysql> show warnings; 
+---------+------+---------------------------------------------------------------+ 
| Level | Code | Message              | 
+---------+------+---------------------------------------------------------------+ 
| Warning | 1478 | InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_per_table. | 
| Warning | 1478 | InnoDB: assuming ROW_FORMAT=COMPACT.       | 
+---------+------+---------------------------------------------------------------+ 
+0

我在更改行格式时没有收到任何警告。 – user962449

+0

这是非常好的答案。谢谢比尔 - 今天也很有用4me ;-) – Artur

相关问题