| View previous topic :: View next topic |
| Author |
Message |
joehni Apprentice


Joined: 27 Jul 2003 Posts: 175
|
Posted: Sun Oct 23, 2005 7:04 pm Post subject: MySQL 4.1.14 charset update disaster [no longer SOLVED] |
|
|
Hello folks,
I don't know how the update from MySQL 4.0.25 to 4.1.14 worked for you, but for me it is an absolute disaster. I have a lot of entries in my DB containing extended characters from latin1 and those cannot be handled with 4.1.14 at all.
By default the ebuild comes with utf8 in my.cnf. Importing the old data with this setting, all extended characters are replaced by '?'. Exchanging utf8 in my.cnf with latin1 works better. I can select rows from the command line and the content is printed all right. But using PHP-based web clients or Knoda the characters are displayed garbled again. Trying to update content that contains an extended character will turn it again into a simple questionmark in the DB.
I really tried a lot of possibilities (and yes, I did a revdep-rebuild) and restarted the server between settings changes and explicitly set the charset of the tables, but nothing. I never got a combination where I could save those characters. For me 4.1.14 us not usable at all.
If somebody had more success with characters like the German Umlauts or accented characters, let me know.
Last edited by joehni on Sat Apr 22, 2006 1:23 pm; edited 2 times in total |
|
| Back to top |
|
 |
Quincy Apprentice


Joined: 02 Jun 2005 Posts: 201 Location: Germany
|
Posted: Mon Oct 24, 2005 12:59 am Post subject: |
|
|
I had strange errors with updating mysql, too. Same problem: latin1 charset doesn't import very well with UTF8 setting.
First error:
Every post (in a forum) containing an "Umlaut" stopped at this point with the rest of information getting lost.
Solution:
Do the export as mentioned in the update instructions and the run "iconv -f ISO8859-15 -t UTF-8" on the your SQL export file.
Second error:
Duplicate entry in a column with an index containing a text.
Solution:
Because of --hex-blob option in the export an unfortunatily set binary attribute for this column text was exported as hex and could not be converted by iconv. Import gives same result as above (shortened entrys) and two of them had teh same beginning causing the duplicate.
Did i already say?
I hate converting charsets...  |
|
| Back to top |
|
 |
joehni Apprentice


Joined: 27 Jul 2003 Posts: 175
|
Posted: Mon Oct 24, 2005 3:34 pm Post subject: |
|
|
| Quincy wrote: |
Do the export as mentioned in the update instructions and the run "iconv -f ISO8859-15 -t UTF-8" on the your SQL export file.
|
Unfortunately this did not work for me either (I also already tried it). If I convert the SQL file and import with latin1 setting in my.cnf the import will again do an automatic conversion and the character is even more garbled. If I have utf8 as default, they are stored/retrieved in the converted form. The only combination where I can at least retrieve the values from the command line is latin1 in my.cnf with the "original" backup file, but this does not work for the PHP-based clients or knoda (they display converted and cannot save). |
|
| Back to top |
|
 |
Quincy Apprentice


Joined: 02 Jun 2005 Posts: 201 Location: Germany
|
Posted: Mon Oct 24, 2005 4:26 pm Post subject: |
|
|
| You have to store the data with latin1 charset? Because importing converted SQL File with Standard UTF-8 Setting is the right combination... |
|
| Back to top |
|
 |
joehni Apprentice


Joined: 27 Jul 2003 Posts: 175
|
Posted: Mon Oct 24, 2005 6:09 pm Post subject: MySQL 4.1.14 charset update disaster [SOLVED] |
|
|
Found the culprit. I had enabled utf8 support in make.conf some time ago and that causes the libmysql to expect strings in utf8 and no longer in latin1. After recompiling mysql without the utf8 flag, I could import the iconv-converted BACKUP (with utf8 settings in my.cnf). The iconv conversion corrupted one DB though, since the client (Amarok) already saves utf8 strings on its own. This can be solved though by letting Amarok recreating its collection.
Now access from Knoda and from the PHP-clients work as expected. Single issue left though is the command line. Requesting data from it will show the result "iconverted"... |
|
| Back to top |
|
 |
joehni Apprentice


Joined: 27 Jul 2003 Posts: 175
|
Posted: Sat Apr 22, 2006 11:04 am Post subject: MySQL 4.1.14 charset update disaster [UNSOLVED again] |
|
|
| Whom do I have to thank? Ebuild for 4.1.14-r1 dropped the utf8 use flag available ein 4.1.14 and all the character conversion problems are back and by DB got corrupted!!! |
|
| Back to top |
|
 |
s|mon Apprentice


Joined: 04 Jul 2004 Posts: 209 Location: Bayern [de]
|
|
| Back to top |
|
 |
magic919 Advocate

Joined: 17 Jun 2005 Posts: 2182 Location: Berkshire, UK
|
Posted: Sat Apr 22, 2006 11:33 am Post subject: Re: MySQL 4.1.14 charset update disaster [UNSOLVED again] |
|
|
| joehni wrote: | | Whom do I have to thank? Ebuild for 4.1.14-r1 dropped the utf8 use flag available ein 4.1.14 and all the character conversion problems are back and by DB got corrupted!!! |
Wouldn't it be worth setting your own use flags for MySQL to protect against this happening? |
|
| Back to top |
|
 |
joehni Apprentice


Joined: 27 Jul 2003 Posts: 175
|
Posted: Sat Apr 22, 2006 11:47 am Post subject: Re: MySQL 4.1.14 charset update disaster [UNSOLVED again] |
|
|
| magic919 wrote: | | joehni wrote: | | Whom do I have to thank? Ebuild for 4.1.14-r1 dropped the utf8 use flag available ein 4.1.14 and all the character conversion problems are back and by DB got corrupted!!! |
Wouldn't it be worth setting your own use flags for MySQL to protect against this happening? |
When I say dropped, I mean it! If an ebuild no longer uses it, I can set it to what and where I want - it will not change the build. |
|
| Back to top |
|
 |
magic919 Advocate

Joined: 17 Jun 2005 Posts: 2182 Location: Berkshire, UK
|
Posted: Sat Apr 22, 2006 11:50 am Post subject: |
|
|
Yes, I see what you mean now. Dropped as in no longer exists for the purposes of the ebuild. Not very helpful then  |
|
| Back to top |
|
 |
joehni Apprentice


Joined: 27 Jul 2003 Posts: 175
|
Posted: Sat Apr 22, 2006 12:28 pm Post subject: |
|
|
| s|mon wrote: | Maybe the workaround of setting
| Quote: | | init-connect='SET NAMES latin1' | in the [mysqld] section of you my.cnf works for you.
adapt latin1 to whatever charset you used to have. |
No, it does not help. |
|
| Back to top |
|
 |
joehni Apprentice


Joined: 27 Jul 2003 Posts: 175
|
|
| Back to top |
|
 |
s|mon Apprentice


Joined: 04 Jul 2004 Posts: 209 Location: Bayern [de]
|
Posted: Sat Apr 22, 2006 1:16 pm Post subject: |
|
|
| Well first you could unmask 4.1.14 and use this until a better solution is found. But you should lookup why it's masked (maybe important) |
|
| Back to top |
|
 |
joehni Apprentice


Joined: 27 Jul 2003 Posts: 175
|
Posted: Sat Apr 22, 2006 1:22 pm Post subject: |
|
|
| That's what I have done. The masking was because of security issues. But this DB and none of its clients is exposed to the internet, so I don't care. Nevertheless I ask my self what is worse - waiting for some attacker corrupting my data or have a version that does it by default. |
|
| Back to top |
|
 |
itti n00b

Joined: 30 Jun 2004 Posts: 40
|
Posted: Sun Apr 23, 2006 2:46 am Post subject: |
|
|
oh man i´ve upgraded mysql on a production server, not knowing that it will make all my latin-1 databases useless... what can i do now? i need this server up and running as soon as possible. why is such a serious thing not mentioned in an emerge warning? i update my software with emerge on a regular basis...  |
|
| Back to top |
|
 |
llongi Retired Dev


Joined: 15 Apr 2004 Posts: 459 Location: Switzerland
|
Posted: Sun Apr 23, 2006 11:17 am Post subject: |
|
|
The latest updates won't make your dbs useless or damage them in any way, the problem is PHP here, which switches to UTF8 regardless of what you may set in my.cnf. This was fixed with dev-lang/php-4.4.2-r1 and 5.1.2-r1, so just emerge that PHP version and change your /etc/mysql/my.cnf so that the [client] section includes the line "default-character-set=latin1". That will revert the behaviour of PHP to what it was before: use latin1 as default charset. _________________ Best regards, Luca. |
|
| Back to top |
|
 |
joehni Apprentice


Joined: 27 Jul 2003 Posts: 175
|
Posted: Sun Apr 23, 2006 6:32 pm Post subject: |
|
|
| My problem is not PHP, but Knoda. It simply does not matter what I put into my.cnf, the DB is wrong starting with 4.1.14-r1. |
|
| Back to top |
|
 |
uppe n00b


Joined: 04 Jul 2004 Posts: 18 Location: Sweden
|
Posted: Sun Apr 23, 2006 6:40 pm Post subject: |
|
|
This worked perfectly for me. I used a mysql version of 5.0.18 though. ^^ |
|
| Back to top |
|
 |
|