简体   繁体   中英

mysqldump routines charset encoding problem

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM