Jump to content

mysql character set


anatak

Recommended Posts

the character set variables are changed somehow.

It used to work perfectly but now (I guess some change at the hostingcompany) made that it doesn't anymore

 

Here are the values of the online database

SHOW VARIABLES LIKE 'c%';

character_set_client latin1

character_set_connection latin1

character_set_database latin1

character_set_filesystem binary

character_set_results latin1

character_set_server latin1

character_set_system utf8

character_sets_dir /usr/share/mysql/charsets/

collation_connection latin1_swedish_ci

collation_database latin1_swedish_ci

collation_server latin1_swedish_ci

completion_type 0

concurrent_insert 1

connect_timeout 10

 

and this is what it looks like on my local system

 

SHOW VARIABLES LIKE 'c%';

character_set_client utf8

character_set_connection utf8

character_set_database utf8

character_set_filesystem binary

character_set_results utf8

character_set_server latin1

character_set_system utf8

character_sets_dir c:wampmysqlsharecharsets

collation_connection utf8_general_ci

collation_database utf8_unicode_ci

collation_server latin1_swedish_ci

completion_type 0

concurrent_insert 1

connect_timeout 5

 

the weird thing is if I look into the phpmyadmin panel variables then I have the same values for both databases

 

online database

character set client  utf8

(Global value) latin1

character set connection utf8

(Global value) latin1

character set database latin1

character set filesystem binary

character set results utf8

(Global value) latin1

character set server latin1

character set system utf8

character sets dir /usr/share/mysql/charsets/

collation connection utf8_unicode_ci

(Global value) latin1_swedish_ci

collation database latin1_swedish_ci

collation server latin1_swedish_ci

 

offline database

 

character set client  utf8

(Global value) latin1

character set connection utf8

(Global value) latin1

character set database latin1

character set filesystem binary

character set results utf8

(Global value) latin1

character set server latin1

character set system utf8

character sets dir c:\wamp\mysql\share\charsets\

collation connection utf8_unicode_ci

(Global value) latin1_swedish_ci

collation database latin1_swedish_ci

collation server latin1_swedish_ci

 

Can anyone help me ?

 

I use this fix for the character_set

http://www.adviesenzo.nl/examples/php_mysql_charset_fix/

 

here is the code

$dbadmin = &ADONewConnection('mysql');
$dbadmin->Connect($Host, $RootUser, $RootPassword, $Database);
$dbadmin_charset = $dbadmin->Execute( "SHOW VARIABLES LIKE 'character_set_database'" );
$dbadmin->Execute( "SET NAMES '" . $dbadmin_charset->fields['Value'] . "'" );

 

thank you

anatak

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.