Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

If a database contains contains table of different charset, what should I do in order to have them appear in a single file? or is it possible?

share|improve this question
up vote 1 down vote accepted

I think you may be better off using the --tab option to mysqldump and dumping each table to a separate .sql and .txt pair of files, but if you want to use a single dump file I'd:

  • Use mysqldump as usual specifying the default charset of the majority of the tables.
  • Then edit the dump file to change the charset in the creation statement for the tables that are different.

If the dump's huge use an editor that can handle such files or make the changes using sed.

A third alternative would be to use just two dump files by selecting tables using the --tables parameter to mysqldump. First select all the regular tables and then select the group that's different, specifying the right charset as default each time.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.