Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Force row_format on mysqldump

I am converting a whole server to use Barracuda file format and dynamic row format. Here's what I did:

  1. full mysqldump
  2. configured *innodb_file_per_table = 1* and *innodb_file_format=barracuda*
  3. resetted all mysql data.
  4. imported all dumped databases.

Since I was creating all databases again e recreating the tables, I was expecting them all to be barracuda but instead most of them are Antelope.

Is there a way to specify the row_format on mysqldump or when importing it?

Note: before someone asks why, I experiment different file formats to test which performs best with our server that has currently 680 databases with a total of 326k tables and 40Gb. Main problem now is that mysql enterprise backup takes too long to backup it all.

like image 229
Johnny Everson Avatar asked Nov 23 '11 14:11

Johnny Everson


1 Answers

Here's how I end up doing it:

after the full dump, I converted the final files using sed:

cat full.sql | sed -e 's/ROW_FORMAT=COMPACT/ROW_FORMAT=DYNAMIC/'  | sed -e '/ROW_FORMAT/!s/^) ENGINE=InnoDB/) ENGINE=InnoDB ROW_FORMAT=DYNAMIC/' > full.mod.sql

This line changes ROW_FORMAT from COMPACT to DYNAMIC and adds ROW_FORMAT=DYNAMIC when no format is specified.

like image 71
Johnny Everson Avatar answered Nov 09 '22 17:11

Johnny Everson