views:

26

answers:

1

Yes, I know what you think, but for the moment we decided to go for latin1.

This is the mySQL config: • mysql> SHOW VARIABLES LIKE 'character_set_%';
• +--------------------------+--------+
• | Variable_name | Value |
• +--------------------------+--------+
• | character_set_client | latin1 |
• | character_set_connection | latin1 |
• | character_set_database | latin1 |
• | character_set_results | latin1 |
• | character_set_server | latin1 |
• | character_set_system | utf8 |> This is impossible to change since it is a default system parameter.

For php we use the following commands at php.ini:
mssql.charset = "ISO-8859-1"

For apache the usual:
AddDefaultCharset ISO-8859-1

With all this everytime we do back up we get the following added to each table:
/*!40101 SET @saved_cs_client = @@character_set_client /;
/
!40101 SET character_set_client = utf8 */;

Why the character_set_client is still in utf8 for connections between apache/php and mysql?

+1  A: 

mysqldump doesn't look at your php or apache settings. You'll need to add the --default-character-set flag when using mysqldump.

From the manual:

--default-character-set=charset_name

Use charset_name as the default character set. See Section 9.5, “Character Set Configuration”. If no character set is specified, mysqldump uses utf8, and earlier versions use latin1.

bradym
This. How PHP connects to the tables won't matter to `mysqldump`, which is UTF-8 by default
Pekka
Thanks bradym, this make senses since I have everything set to Latin1. I will keep an eye on the manual you linked to. Thanks!
Jorge