mySql can't display Chinese character,alway show like "???"

Problems with the Mac OS X version of XAMPP, questions, comments, and anything related.

mySql can't display Chinese character,alway show like "???"

Postby elliotxin » 13. September 2014 07:26

My OS is 10.9.4,and i installed XAMPP version is 1.8.3-5.my system is display in english and i set up XAMPP is Chinese display in localhost webpage and phpMyadmin also display in Chinese.
So now i faced very strange problem, when i insert Chinese name in the database, the database table is alway show ??? in the database.

    mysql> select * from user1;
    +----+------+----------------------------------+--------------------+-----+
    | id | name | password | email | age |
    +----+------+----------------------------------+--------------------+-----+
    | 2 | xm | 202cb962ac59075b964b07152d234b70 | xiaoming@sohu.com | 34 |
    | 3 | xz | 202cb962ac59075b964b07152d234b70 | xiaozheng@sohu.com | 28 |
    | 4 | ?? | 202cb962ac59075b964b07152d234b70 | xiaoming@sohu.com | 34 |
    | 5 | ??? | 202cb962ac59075b964b07152d234b70 | xiaoming@sohu.com | 34 |
    | 6 | ?? | 202cb962ac59075b964b07152d234b70 | wangying@sohu.com | 13 |
    +----+------+----------------------------------+--------------------+-----+
    5 rows in set (0.03 sec)

after that i type "show variables like '%char%';"

    mysql> show variables like '%char%';
    +--------------------------+------------------------------------------------+
    | Variable_name | Value |
    +--------------------------+------------------------------------------------+
    | character_set_client | utf8 |
    | character_set_connection | utf8 |
    | character_set_database | latin1 |
    | character_set_filesystem | binary |
    | character_set_results | utf8 |
    | character_set_server | latin1 |
    | character_set_system | utf8 |
    | character_sets_dir | /Applications/XAMPP/xamppfiles/share/charsets/ |
    +--------------------------+------------------------------------------------+
    8 rows in set (0.29 sec)
Then i change the "character_set_database" and "character_set_server" both to utf8,after insert a now inform, unfortunate the database still display ???,when i
restart the XMAPP ,the variables table become this again:

    mysql> show variables like '%char%';
    +--------------------------+------------------------------------------------+
    | Variable_name | Value |
    +--------------------------+------------------------------------------------+
    | character_set_client | utf8 |
    | character_set_connection | utf8 |
    | character_set_database | latin1 |
    | character_set_filesystem | binary |
    | character_set_results | utf8 |
    | character_set_server | latin1 |
    | character_set_system | utf8 |
    | character_sets_dir | /Applications/XAMPP/xamppfiles/share/charsets/ |
    +--------------------------+------------------------------------------------+
    8 rows in set (0.29 sec)

So,please help me fix the issure,Thanks a lot.
elliotxin
 
Posts: 1
Joined: 12. September 2014 20:01
Operating System: MAC

Return to XAMPP for macOS

Who is online

Users browsing this forum: No registered users and 8 guests