Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
åäö in mysql problem
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3, 4, 5  Next  
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
dodger10k
Tux's lil' helper
Tux's lil' helper


Joined: 27 Jun 2003
Posts: 97

PostPosted: Wed Apr 19, 2006 10:13 am    Post subject: Reply with quote

Me again,

as this mixture of latin1 and utf8 gave me some disturbance (especially since the database HAS utf8 collation) I re-emerged mysql with utf8-support.

STILL DOESN'T WORK!!!

Here's the actual debug-output of the php-script, just in case...

Quote:

The current character set is: utf8
Get the charset data: character_set_client -_-_- utf8
character_set_connection -_-_- utf8
character_set_database -_-_- utf8
character_set_results -_-_- utf8
character_set_server -_-_- utf8
character_set_system -_-_- utf8
character_sets_dir -_-_- /usr/share/mysql/charsets/
Get the collation data:
collation_connection -_-_- utf8_general_ci
collation_database -_-_- utf8_general_ci
collation_server -_-_- utf8_general_ci


This definitely is a horrible situation, there has to be some kind of solution?!? Maybe I´ve overlooked something???
Back to top
View user's profile Send private message
llongi
Retired Dev
Retired Dev


Joined: 15 Apr 2004
Posts: 459
Location: Switzerland

PostPosted: Wed Apr 19, 2006 11:14 am    Post subject: Reply with quote

The idea here is that with the new MySQL and PHP you're able to set the charsets you want, so that you can bring the situation back to the old one, if you have problems. Now, knowing _what_ the old situation was, is a *must* here...
So if you set it all to latin1 or all to utf8, and still have problems, it's pretty obvious that before you didn't have all latin1 or all utf8. That the server charset changed is pretty hard, so it's probably the client (PHP) charset... So just experiment with the [client] default-character-set until it works (until you restore the mix of charsets it had before).
_________________
Best regards, Luca.
Back to top
View user's profile Send private message
doc.twn
n00b
n00b


Joined: 20 Nov 2002
Posts: 15
Location: Luxembourg

PostPosted: Wed Apr 19, 2006 1:07 pm    Post subject: Reply with quote

my configuration after the upgrade was exactly the same for mysql as before, latin1 everywhere.

yet, there was just one little detail... mbstring!

after the upgrade to 4.4.2-r1 all apache2 php modules on all my servers were compiled with '--disable-mbstring', i don't know why suddenly the mbstring extension was missing. before the update everything was working fine and the mbstring extension was always part of my php module.

now with 4.4.2-r1 i had to add the "unicode" use flag to get the mbstring extension back, and after that, everything just worked fine again.

so if you applied all the fixes mentioned in this thread and still got the same problems, as i did, please verify if the mbstring extension is activated in php. if it's not you apparently have to use the "unicode" useflag now to enable it.

maybe it will solve your "umlaut"-problems as well, at least it worked for me.

cheers
_________________
Keyboard not found, Press F1 to continue...
Back to top
View user's profile Send private message
dodger10k
Tux's lil' helper
Tux's lil' helper


Joined: 27 Jun 2003
Posts: 97

PostPosted: Wed Apr 19, 2006 1:33 pm    Post subject: Reply with quote

doc.twn wrote:
yet, there was just one little detail... mbstring!
[...]
maybe it will solve your "umlaut"-problems as well, at least it worked for me.
cheers


Maaan, you just saved my day :-) GREAT, it worked! After spending whole night trying to get this up and running again I finally can get some rest :-)

Thanks, MATE! :-)
Back to top
View user's profile Send private message
scdgro
n00b
n00b


Joined: 16 Nov 2002
Posts: 56

PostPosted: Wed Apr 19, 2006 5:59 pm    Post subject: Reply with quote

THANKS YOU GENTOO !! I would rather say something that isn't allowed to say....

Ik also f*cked up my complete mysql database after upgrading to 14-r1

Lucky i got a backup.
Back to top
View user's profile Send private message
scdgro
n00b
n00b


Joined: 16 Nov 2002
Posts: 56

PostPosted: Wed Apr 19, 2006 6:31 pm    Post subject: Reply with quote

Hmm. It seems that just emerging the 4.1.14 version solves all problems.

But ....

as long as you didn't have tried to alter the tables. Than you have a slighter bigger problem..
Back to top
View user's profile Send private message
luispa
Guru
Guru


Joined: 17 Mar 2006
Posts: 342
Location: España

PostPosted: Wed Apr 19, 2006 7:44 pm    Post subject: Reply with quote

Going to dev-lang/php-5.1.2-r1 and adding default-character-set=latin1 to my original my.cnf solved also the problem, however some articles I was playing with while trying to fix it (before knowing the solution) got definitely corrupted, and I need probably to retype all accents again (spanish).

Do you know of any migration tool, guide, or document, to convert all my current databases (latin1) to utf8?

thanks in advance,
luis
Back to top
View user's profile Send private message
jannis
Guru
Guru


Joined: 05 Dec 2004
Posts: 322
Location: Germany / Bavaria / Aschaffenburg

PostPosted: Thu Apr 20, 2006 12:44 pm    Post subject: Reply with quote

Just one thing for you all to think about:
I got a mysql server running on my dedicated server and all the mysql- and PHP-stuff on this machine works. The PHP-engine reads the client-part of the my.cnf-file and displays the chars correctly (finally :x ).

But one problem still remains:
I've got one php-board (woltlab) running on a different server, getting the mysql-stuff from my dedicated server. And: yes, it CANNOT read the my.cnf (it doesn't even run gentoo, so doesn't have a patched php-version). And as you might guess, the "umlauts" are NOT displayed correctly.
Using the workaround
Code:
[mysqld]
init-connect='SET NAMES latin1'
works but is defenitely just a workaround.

Any better solution for this case?
Back to top
View user's profile Send private message
doc.twn
n00b
n00b


Joined: 20 Nov 2002
Posts: 15
Location: Luxembourg

PostPosted: Thu Apr 20, 2006 1:07 pm    Post subject: Reply with quote

scdgro wrote:

Lucky i got a backup.


how often did i say that already, i really started to discover the whole potential of my backup software since i started using gentoo.

after finally having resolved the charset problems, i already had to explain the whole situation to the management here and they were not pleased at all.

two hours later i update dev-php/smarty from 2.6.10 to 2.6.13, 2.6.10 used /usr/lib/php as the install dir but with 2.6.13 it changes to /usr/share/php. guess what, after the update all sites using smarty templates wor offline, again!
i noticed that with the switch from dev-php/php to dev-lang/php the pear directory moved to /usr/share/php as well. so i had to create a symlink between /usr/lib/php and /usr/share/php just to be safe. and later the pear shell command didn't work anymore.

and again i had to explain to management what happend. that was the last straw, we're considering switching our gentoo servers (about 30 servers) to another distro.

i really like gentoo, it's a great distro and has lots and lots of advantages. but it's just too risky to update, almost everytime you update there'll be some surprises. and it's a lot of maintenance, with everything changing every 6 months. especially the apache, php and mysql stuff.
_________________
Keyboard not found, Press F1 to continue...
Back to top
View user's profile Send private message
uppe
n00b
n00b


Joined: 04 Jul 2004
Posts: 18
Location: Sweden

PostPosted: Mon Apr 24, 2006 1:42 am    Post subject: Reply with quote

I was experiencing the exact same thing as the thread starter originally posted. ÅÄÖ was outputted as UTF-8 whether I wanted it to or not.

I found this quote in a similar thread. This worked perfectly for me. I used a mysql version of 5.0.19 though, but I guess the problem source is the same ^^

s|mon wrote:
See https://bugs.gentoo.org/show_bug.cgi?id=129761 and
https://forums.gentoo.org/viewtopic-t-436439.html

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.
Back to top
View user's profile Send private message
kitana_ann
Tux's lil' helper
Tux's lil' helper


Joined: 04 Sep 2003
Posts: 117

PostPosted: Wed Apr 26, 2006 9:09 am    Post subject: Reply with quote

Hi, I am having this exact same problem.

I am wondering how I downgrade to mysql-4.1.14 :oops:

What emerge command to I use?

Thanx for reply.
Back to top
View user's profile Send private message
jannis
Guru
Guru


Joined: 05 Dec 2004
Posts: 322
Location: Germany / Bavaria / Aschaffenburg

PostPosted: Wed Apr 26, 2006 10:34 am    Post subject: Reply with quote

Please read the whole thread before you reply. Downgrading to 4.1.14 is possible but shouldn't be done. Either upgrade your PHP if you only have problems concerning PHP or use the "workaround" mentioned in this thread.
Back to top
View user's profile Send private message
kitana_ann
Tux's lil' helper
Tux's lil' helper


Joined: 04 Sep 2003
Posts: 117

PostPosted: Wed Apr 26, 2006 12:56 pm    Post subject: Reply with quote

:D Yes, when I first replied I only thought there was one page on this thread. After I replied I saw there was 4 pages. I did not take away my post becouse I was so busy reading everything and trying to solve the problem at the same time. :lol:

So next time I will dubbel check :wink:
Back to top
View user's profile Send private message
SoylentGreen
l33t
l33t


Joined: 19 Aug 2005
Posts: 904
Location: The Hostel

PostPosted: Wed Apr 26, 2006 1:04 pm    Post subject: Reply with quote

kitana_ann wrote:
trying to solve the problem at the same time. :lol:

well, *is* it solved for you now as well? please keep in mind that the developer is reading here as well.
for me it looks like this problem is meanwhile solved for everyone.
Back to top
View user's profile Send private message
kitana_ann
Tux's lil' helper
Tux's lil' helper


Joined: 04 Sep 2003
Posts: 117

PostPosted: Wed Apr 26, 2006 1:32 pm    Post subject: Reply with quote

:) I am holding my fingers krossed still. I am right now emerging mysql-4.1.14-r1 again. And will do the same with php.

I started emerging PHP but it gives me this message:

Code:
emerge -pv php

These are the packages that I would merge, in order:

Calculating dependencies   

!!! The short ebuild name "php" is ambiguous.  Please specify
!!! one of the following fully-qualified ebuild names instead:

    dev-lang/php
    dev-php/php


I am so imberessed to ask what the php packege is called. I ran a search on all php packages and I have none installed 8O.

So, what does the package call :)
Back to top
View user's profile Send private message
SoylentGreen
l33t
l33t


Joined: 19 Aug 2005
Posts: 904
Location: The Hostel

PostPosted: Wed Apr 26, 2006 1:47 pm    Post subject: Reply with quote

jesus fscking christ, why dont you read this thread first?
dev-lang/php is your pick.
Back to top
View user's profile Send private message
kitana_ann
Tux's lil' helper
Tux's lil' helper


Joined: 04 Sep 2003
Posts: 117

PostPosted: Wed Apr 26, 2006 2:15 pm    Post subject: Reply with quote

I see I have to upgrade my PHP4 to PHP5. I get this error:

Code:
emerge -p dev-lang/php

These are the packages that I would merge, in order:

Calculating dependencies ...done!
[blocks B     ] dev-php/mod_php (is blocking dev-lang/php-5.1.2-r1)
[blocks B     ] dev-php/php (is blocking dev-lang/php-5.1.2-r1)
[ebuild  N    ] app-admin/php-toolkit-1.0-r2 
[ebuild  N    ] dev-lang/php-5.1.2-r1


So I am folowing upp a new thread. Guess this will take some time. :roll:
Back to top
View user's profile Send private message
SoylentGreen
l33t
l33t


Joined: 19 Aug 2005
Posts: 904
Location: The Hostel

PostPosted: Wed Apr 26, 2006 2:29 pm    Post subject: Reply with quote

would you mind using the searchfunctions, reading howtos, sticky post, and whatnot? :twisted:
Code:

 [blocks B     ] dev-php/mod_php (is blocking dev-lang/php-5.1.2-r1)
 [blocks B     ] dev-php/php (is blocking dev-lang/php-5.1.2-r1)

emerge -C dev-php/mod_php dev-php/php
emerge dev-lang/php

this is *basic* knowledge!
people have written HOWTOS and whatnot how to do this.

AND BACKUP YOUR SYSTEM FIRST !!!
Back to top
View user's profile Send private message
kitana_ann
Tux's lil' helper
Tux's lil' helper


Joined: 04 Sep 2003
Posts: 117

PostPosted: Wed Apr 26, 2006 2:32 pm    Post subject: Reply with quote

:oops:

Sorry for not knowing this. Thank you for your help.

I will try this.
Back to top
View user's profile Send private message
m27315
Apprentice
Apprentice


Joined: 10 Dec 2004
Posts: 234
Location: 2 workstations down

PostPosted: Thu Apr 27, 2006 1:53 pm    Post subject: don't forget the new php style Reply with quote

Code:
emerge dev-lang/php

tries to pull in php5 for me. I really want php4, so I had to emerge it like so:

Code:
emerge =dev-lang/php-4*

Otherwise, everything worked for me after performing these steps given here, earlier in this thread:

https://forums.gentoo.org/viewtopic-p-3254919.html#3254919

Plus, I rebooted to restart all the services cleanly... :-)

In case you have not already, you may want to check out the PHP upgrade guide, in case you are still using old-school php (which you seem to be doing, kitana_ann):

http://www.gentoo.org/proj/en/php/php-upgrading.xml

I believe earlier instructions assume that you have upgraded. Plus, I think they assume you want to use php5, given my experience of it trying to pull in php5.
Back to top
View user's profile Send private message
lysergicacid
Guru
Guru


Joined: 25 Nov 2003
Posts: 352
Location: The Universe,Virgo Super Cluster,Milky Way,Earth

PostPosted: Fri Apr 28, 2006 12:29 am    Post subject: Reply with quote

sidenote mysql-4.1.14-r1 or anything higher also breaks verlihub databases with special chars not just php
:evil: :evil: :evil: :evil: :evil: :evil: :evil: :evil: :evil:

downgrading to 4.1.14 also fixed my hub database :) :) u guys rock ty for helping even tho i didnt ask for help or wasnt invoved in this.
_________________
[img]http://valid.canardpc.com/cache/banner/2040927.png[/img]
Desktop:
[img]http://valid.canardpc.com/cache/banner/2703952.png[/img]
Back to top
View user's profile Send private message
jonfr
l33t
l33t


Joined: 20 Jul 2003
Posts: 908
Location: Denmark

PostPosted: Fri Apr 28, 2006 2:17 pm    Post subject: Reply with quote

CHTEKK wrote:
We had a bug in the eclass, this bug made all older versions compile with latin1 as default charset. This was wrong. We fixed it, now the -r1's compile correctly with utf8 as default charset. Problem: your databases are in latin1 format. Solution: set the defatult-character-set in my.cnf to latin1. BUT this fixes it only for the mysql* stuff, PHP doesn't read my.cnf, so it tries to interpret stuff now as utf8, but you data is latin1 encoded --> TROUBLE! The fix we're working on is to make PHP read too my.cnf, so that if there you set latin1 as default, it will indeed use latin1 too. This may take a while to be done and tested et all, it was a problem we didn't foresee, sorry for that. Once all is ready and working as expected, PHP and MySQL will be both revbumped, the goal once that is done is the following: new installs will use utf8 for both PHP and MySQL, and that's it. For people like you that have still latin1 databases around, you then just need to set it in my.cnf, and it will work.


Utf-8 is a bad format for anything that is not english. I don't even understan why utf-8 is even used. I know what it is ment to do, but i also know what i doesn't do.
Back to top
View user's profile Send private message
kybber
Apprentice
Apprentice


Joined: 25 Jun 2002
Posts: 228
Location: Trondheim, Norway

PostPosted: Fri May 05, 2006 1:23 am    Post subject: Reply with quote

I have been having the same problem as everyone else here: phpBB spits out weird characters for æ, ø and å, the three special
Norwegian letters. I solved it by adding the line default-character-set=latin1 to the [client] section of my.cnf, as suggested in this
thread. But there is something I don't understand: The database seems to be utf8 all over, my.cnf mentions no other encoding
than utf8 in all sections except [client], and the test-script that was posted in this thread told me utf8 on all points before I added
the line under [client]. So if everything is set up to UTF8, including PHP which by default uses unicode, why on earth do I need to
force PHP to use latin1 in my.cnf? That just doesn't make any sense to me... Can someone please explain the rationale behind this?

Edit: One thing I find highly peculiar is that Drupal works fine regardless of client character set, wheras phpBB hates utf8 and needs
latin1. They ar both running on the same server. Since Drupal also uses PHP, is this an indication that it is really phpBB that is messed
up in my case?
Back to top
View user's profile Send private message
llongi
Retired Dev
Retired Dev


Joined: 15 Apr 2004
Posts: 459
Location: Switzerland

PostPosted: Fri May 05, 2006 9:52 am    Post subject: Reply with quote

Basically, the situation was like this, if you don't change anything:

BEFORE
mysql utf8, php latin1

NOW
mysql utf8, php utf8

(MySQL may vary, but PHP always was latin1)

So if you want things to be like before, you MUST set PHP back to latin1, by emerging the new version and setting the default charset in the [client] section of my.cnf.
_________________
Best regards, Luca.
Back to top
View user's profile Send private message
kybber
Apprentice
Apprentice


Joined: 25 Jun 2002
Posts: 228
Location: Trondheim, Norway

PostPosted: Fri May 05, 2006 10:41 am    Post subject: Reply with quote

Ah, thank you! I didn't know that PHP was Latin1 before - that explains it. :)

But... and there's always a but... that doesn't fully explain why Drupal works regardless of client setting, even though it uses PHP, while
phpBB is messed up?

Another funny thing is that if I set character encoding under client to be UTF8, thus messing up already existing æ, ø and å in phpBB,
and try to enter a post with one of those characters, the part of the post after and including the first such character disappears. I
would have assumed that phpBB would then just save the characters/post as UTF8, but apparently it doesn't.

This makes me feel a bit like this is a bandaid-solution. If I were to do a complete reinstall of everything today, wouldn't I then end up
with a system that has both MySQL and PHP with full UTF8 support and therefore no need to set character encoding to latin1 in my.cnf?If so, how would I be able to get to that point without reinstalling? I suppose if I were to dump the database, convert from latin1 to utf8
and then import it again, this would solve the current characters in pbpBB? That still leaves the problem with newly entered characters,
as I mentioned immediately above.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Goto page Previous  1, 2, 3, 4, 5  Next
Page 4 of 5

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum