mysqldump routines charset encoding problem

192 views Asked by At

How could I possibly dump MySQL database structure and data on windows with mysqldump with polish characters ("ęóąśłżźćń") included?

So far I've managed to dump it altogether using mysqldump.exe <my_settings> --default-character-set=cp1250. It appears to solve at least my data inserts encoding problem since I've set it to cp1250 (Windows Central European) instead of latin2.

The problematic phrases are within my db structure code. For instance: all my stored procedures and functions contain these "special" characters in their comments. I believe, for some reason, they are interpreted as utf8 instead of cp1250. No matter what encoding I set, my comments stay intact.

I believe there must be some other separate setting for routines charset encoding I'd missed. I know it's possible to achieve since I dumped it with workbench data export and somehow it worked. Sadly I wasn't able to check cnf file content since it disappears right afterwards.

Any help would be much appreciated. Especially one excluding potential script conversions.

Cheers

1

There are 1 answers

0
Rick James On

Drop the stored routines, SET NAMES to the desired charset, re-CREATE the routines.

Confirm with SHOW CREATE PROCEDURE name and look at the charset given at the end.