Home > database >  MySQL Chinese show not to come out, empty out automatically? How to solve? Novice consult thank you.
MySQL Chinese show not to come out, empty out automatically? How to solve? Novice consult thank you.

Time:09-25

As follows: the following two ` sid `=1 column after ` sname ` column in the database, I have a Chinese why in this display, empty directly?
Welcome to the MySQL monitor. Commands end with; Or \ g.
Your MySQL connection id is 30
Server version: 5.1.30 - community MySQL community Server (GPL)

Type 'help. 'or' h \ 'for help. Type' \ c 'to clear the buffer.

Mysql> Use the test
The Database changed
Mysql> Select * from stu.
+ -- -- -- -- -- - + -- -- -- -- -- -- -- -- +
| sid | sname |
+ -- -- -- -- -- - + -- -- -- -- -- -- -- -- +
| 1 | |
| 1 | |
| NULL | NULL |
| 2 | asd |
+ -- -- -- -- -- - + -- -- -- -- -- -- -- -- +
4 rows in the set (0.00 SEC)

Mysql>

CodePudding user response:

One possibility is stored in the records in the table itself is not a Chinese character set,

CodePudding user response:

The set GBK nams;
Select * from stu. Have a try

CodePudding user response:

reference 1st floor ACMAIN_CHM response:
a is likely to be stored in the record itself is not a Chinese character set in the table,


How can I know the Chinese character set is stored in the record in a table? Thank you ~

CodePudding user response:

refer to the second floor rucypli response:
set GBK nams.
Select * from stu. Try


GBK tried under no, test utf8, not 0.0

CodePudding user response:

1, my cny modify add character_set_server=utf8
2, the CREATE DATABASE library name CHARACTER SET 'utf8 COLLATE' utf8_general_ci ';
3, CREATE TABLE TABLE name (... ) ENGINE=MYISAM CHARACTER SET utf8;

CodePudding user response:

Let's first take a look at the table of the character set
Show create table to look at, whether table itself does not support Chinese character set,

Then the database character set,

And then check the terminal you use character set,

CodePudding user response:

Windows is a cancer, on the console does not support utf-8, so can't, either with GBK, it is to use the graphical interface
  • Related