2012-11-29 81 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

相關問題