1
votes

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?

2
How do you back up your tables?Pekka
I am using mysqldump from the command line. This gives me a .sql type of file. When I open the .sql file I find the SET character_set_client = utf-8 on every table as described above... Very bizarre since all php, apache and mysql are latin1/iso-8859-1Jorge

2 Answers

3
votes

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.

0
votes

if you notice carefully the directive in the php.ini you have set:

mssql.charset = "ISO-8859-1"

refers to Microsoft SQL Server! connections and not to MySQL Server.

jackman