MySQL Forums
Forum List  »  Backup

Re: mysqldump file/data encoding craziness
Posted by: Matthew Lenz
Date: May 27, 2012 01:44PM

Rick James Wrote:
-------------------------------------------------------
> > I believe debian recently moved to using utf-8
> as the default file character set.
> Are you stating something about the Operating
> system, or about mysql??

OS

> > We also have another app based on the same code
> and it's dumps always result in a 'file' command
> of UTF-8.
> What 'file' command? The one in the OS? What are
> you trying to tell us?

http://en.wikipedia.org/wiki/File_(command)

> > So I instead of grepping out the import tokens.
> Elaborate.

the /*!#### hints? import comments? No idea what they are called.

> > dump/load ALL the table creates
> via mysqldump? Please provide the command
> arguments that you used.

mysqldump -hxxxx db table1 table2

> > example of the tokens
> What do you mean by "token"?

the /*!#### hints? import comments? No idea what they are called.


> "-- " introduces a comment that lasts until the
> end of the line.

Eeeyep.

> > /*!40101 SET NAMES utf8 */;
> That says that the rest of the mysqldump file will
> be _interpreted_ as utf8-encoded.
>
> > /*!40101 SET character_set_client = utf8 */;
> This is a part of the SET NAMES; again, it says
> that the dump is interpreted as utf8.
>
> I highlighted "interpreted" because if the bytes
> are not in utf8, you have a mess.

It doesn't matter if I use params to change set names. default character set, etc. It doesn't matter what file type the dump creates. The only thing that allows it to import and work correctly is removing all the /*!#### lines from the dump before importing.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: mysqldump file/data encoding craziness
3935
May 27, 2012 01:44PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.