Page 1 of 1

phpMyAdmin - How to change "MySQL charset: UTF-8 Unico

PostPosted: 18. March 2005 21:58
by prosto
Hi.

I'm having troubles importing data because of this UTF-8 setting.
How can I switch it to a different one?

Thank you.

PostPosted: 19. March 2005 20:05
by prathapml
I believe you need to edit my.cnf

PostPosted: 19. March 2005 22:30
by prosto
my.cnf:
character-set-server = latin1
collation-server = latin1_general_ci

There's also a line there that's commented out:
# default-character-set=utf8
But playing around with it doesn't solve the problem...

PostPosted: 20. March 2005 23:58
by sckoh
You cannot change the basic charset, utf8 to others. That's a limit condition of Mysql 4.
You can check and see the values at phpmyadmin.

PostPosted: 22. March 2005 23:44
by prosto
sckoh wrote:You cannot change the basic charset, utf8 to others. That's a limit condition of Mysql 4.

That's not true...

I don't know what's happening but I would like to get a response from XAMPP team on my problem.

Thanx.

PostPosted: 23. March 2005 00:33
by Wiedmann
I'm having troubles importing data because of this UTF-8 setting.

Can you explain more exactly your described problems?

PostPosted: 23. March 2005 01:03
by prosto
OK.

When I open phpMyAdmin on the right side under "Language" and above "MySQL connection collation" selection it says: "MySQL charset: UTF-8 Unicode (utf8)"

So, this tells me that it's not what I have in my.cnf.
Where do we set this MySQL charset then?

I have dumps of DBs which are in CP1251.
But they are all stored in UTF-8.
And for some reason when I open my test site in the browser everything looks like "????? ?? ??????????" in any encoding.

I dunno where to look at.
If you point me in the right direction I would be very grateful.

PostPosted: 23. March 2005 02:02
by Wiedmann
Well...

When I open phpMyAdmin on the right side under "Language" and above "MySQL connection collation" selection it says: "MySQL charset: UTF-8 Unicode (utf8)"

This is nothing you can change. This shows you the charset of the OS where MySQL is running on.

So, this tells me that it's not what I have in my.cnf.
Where do we set this MySQL charset then?

The default charset in XAMPP should be "Latin1", with the collation "latin1_general_ci". So it might be a good idea, to change the " MySQL connection collation" in phphMyAdmin to this setting, too.

Every new database/table you create, will have this settings. But you can define a different charset for each db/table within the "CREATE" - statement. If you want to change the default, you can do this in the "my.cnf".

In phpMyAdmin you can see the current settings at "Show MySQL system variables".

have dumps of DBs which are in CP1251.
But they are all stored in UTF-8.

Sorry, no really idea. What is the charset from the db before you import some data? Try to import with a commandline tool ("mysql.exe") and set the correct charset parameter.

Have a look at: http://dev.mysql.com/doc/mysql/en/charset.html

And for some reason when I open my test site in the browser everything looks like "????? ?? ??????????" in any encoding.

Or you have a problem with Apache (too). Hav you defined " AddDefaultCharset foo" in the "httpd.conf"?

PostPosted: 23. March 2005 17:27
by prosto
The default charset in XAMPP should be "Latin1", with the collation "latin1_general_ci". So it might be a good idea, to change the " MySQL connection collation" in phphMyAdmin to this setting, too.

Yes, everything is set to these settings.

Or you have a problem with Apache (too). Hav you defined " AddDefaultCharset foo" in the "httpd.conf"?

Yes, I played with this setting too.


Could it be phpMyAdmin settings problem?

When I create DB with cp1251_general_ci collation and then import dump with character set cp1251, this is the only time when I can later read and edit data in phpMyAdmin with no problems. Browser encoding setting is UTF-8.
But I'm getting ??????? ?? ??? when opening my site in the browser as I described before.

Now, if I create DB with latin1_general_ci collation and import dump with latin1, this is the only time I can finally read my pages.
But in phpMyAdmin all the data is displayed in symbols in any encoding selected in my browser...
And I cannot edit my data.

What can I try with config.inc.php?
My $cfg['DefaultCharset'] = 'iso-8859-1';

I'm totally confused...

PostPosted: 06. April 2005 03:24
by sckoh
Hi, Gentlemen.
Default charset in Mysql 4.1.10 is utf-8 which is unable to change, as before 4.1.x was latin1 as fixed as well.

All the others can be changable with command
"mysql>set names YOUR CHARSET;" or,
"mysql>set session names YOUR CHARSET;"

And you can see how it has been changed,
"mysql>show variables like 'c%';"

You' can understand that global values are changale except system charactor utf-8 but session values are remain unchanged.

If you know the way to change session values, please let me know.

PostPosted: 06. April 2005 03:28
by sckoh
prosto wrote:What can I try with config.inc.php?
My $cfg['DefaultCharset'] = 'iso-8859-1';

I'm totally confused...

It is not apache's or phpmyadmin's problem, but mysql 4.1.10's matter.
Until you return to old mysql, you cannot fix the problem.