If you are running ‘OPTIMIZE TABLE’ or altering ‘TABLESPACE’ just
be careful not to kill MySQL service while running these
commands
Here is a test case:
We have a table:
CREATE TABLE `sbtest1` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`k` int(10) unsigned NOT NULL DEFAULT '0',
`c` char(120) NOT NULL DEFAULT '',
`pad` char(60) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
KEY `k_1` (`k`)
) ENGINE=InnoDB AUTO_INCREMENT=2427738 DEFAULT CHARSET=latin1
COMPRESSION='lz4'
After a while we want to ‘OPTIMIZE’ this table:
mysql> optimize table sbtest1;
ERROR 2013 (HY000): Lost connection to MySQL server during
query
Uups MySQL process was killed/crashed.
[root@ps-5 mysql]# ls -l dbtest/
total 1092792
-rw-r-----. 1 mysql mysql 65 фев 4 03:43 db.opt
-rw-r-----. 1 mysql mysql …