1.所有节点修改参数先
vim /home/mysql/conf/s01.cnf
vim /home/mysql/conf/s02.cnf
#compress
innodb_file_format=Barracuda
innodb_file_per_table=1
mysql> set global innodb_file_format=Barracuda;
mysql> SET GLOBAL innodb_file_per_table=1;
check:
mysql> show variables like 'innodb_file%';
2.检查状态(主)
use bdzh;
mysql> show table status like 'dim_image'\G
Row_format: Compact --未压缩
3.压缩表在线操作(主)
mysql> alter table dim_image key_block_size=8 row_format=compressed;
4.检查是否压缩( 主备)
mysql> show table status like 'dim_image'\G
Row_format: Compressed --压缩了
1.6g的表压缩到了1.2g。用时<2min。实际使用效率待测试.
vim /home/mysql/conf/s01.cnf
vim /home/mysql/conf/s02.cnf
#compress
innodb_file_format=Barracuda
innodb_file_per_table=1
mysql> set global innodb_file_format=Barracuda;
mysql> SET GLOBAL innodb_file_per_table=1;
check:
mysql> show variables like 'innodb_file%';
2.检查状态(主)
use bdzh;
mysql> show table status like 'dim_image'\G
Row_format: Compact --未压缩
3.压缩表在线操作(主)
mysql> alter table dim_image key_block_size=8 row_format=compressed;
4.检查是否压缩( 主备)
mysql> show table status like 'dim_image'\G
Row_format: Compressed --压缩了
1.6g的表压缩到了1.2g。用时<2min。实际使用效率待测试.