Force row_format on mysqldump
Asked Answered
Z

1

7

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.

Zia answered 23/11, 2011 at 14:38 Comment(0)
Z
15

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.

Zia answered 23/11, 2011 at 19:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.