<img src="//up.zaixiankaoshi.com/docs/0b/75/0b75cef387f8036d9a6cfe3b344b6100.png" style="width: auto;" class="fr-fic fr-fil fr-dib">
A、Settheservertouseitsowntablespace,andthenalterthetablesothatdataismovedfromthesharedtablespacetoitsown:Mysql>SETGLOBAinnodb_fileper_table=1;Mysql>ALTERTABLEdata_currentENGINE=InnoDB;mysql>ALTERTABLEdata_reportsENGINE=InnoDB;
B、ExecuteoPrIMI2ETABEESothattheInnoDBenginefreesunusedpagesondiskbacktothefilesystem:Mysql>0PTIMIZETABLEdata_current,data_reports;
C、Enablecompressiononthetable,causingInnoDBtoreleaseunusedpagesondisktothefilesystem:Mysql>SETGLOBALinnodb_file_per_table=1;Mysql>SETGLOBALinnodb_file_format=Barracuda;Mysql>ALTERTABLEdata_currentROW_FORMAT=COMPRESSEDKEY_BLOCK_SIZE=8;mysql>ALTERTARLEdata_historyROw_FORMAT=COMPRESSEDKEY_BLOCK_SIZE=8;
D、Takeabackup,stoptheserver,removethedatafiles,andrestorethebackup:Shell>mysqldump-uroot-papplicationdb>/backup/applicationdb.sqlshel1>/etc/init.d/mysqlstopShell>cd/var/lib/mysql/Shell>rmibdata1ib_logfile0ib_logfile1shell>/etc/init.d/mysqlstartShell>mysgl-uroot-papplicationdb</backup/applicationdb.sql