Home > database >  Mysql to set the default encoding set utf-8, still can't type in Chinese, to solve
Mysql to set the default encoding set utf-8, still can't type in Chinese, to solve

Time:09-25

Environment is Windows 7 64 pro, mysql5.5
Have changed the default encoding mysql sets utf-8, but inserted into the Chinese language is still an error, see below

CodePudding user response:


This is to specify the default character set when installed, change again after installed, is useless, so before you install, it is the use of the utf-8

CodePudding user response:

To implement

The set names' GBK ';

And then do the insert

CodePudding user response:

reference 1st floor yupeigu response:
this is to specify the default character set when installed, change again after installed, is useless, so before you install, is to use the utf-8?


No, didn't specify code mysql5.5 installation, so I am after the completion of the installation manually change the client and server code for utf-8

CodePudding user response:

reference RYM_Google reply: 3/f
Quote: refer to 1st floor yupeigu response:


This is to specify the default character set when installed, change again after installed, is useless, so before you install, is to use the utf-8?


No, didn't specify code mysql5.5 installation, so I am after the completion of the installation manually change the client and server code for utf-8


Try the moderator,

CodePudding user response:

Check your native what character set is a command line window, and then set names have to be set to anything,

CodePudding user response:

The set names utf8;

CodePudding user response:

First look at the client character set
Set up the client's character set not utf8 (set names utf8)

Then look at your terminal character set that will end the character set is also modified to utf8

CodePudding user response:

refer to the second floor ACMAIN_CHM response:
perform first

The set names' GBK ';

And then do the insert

This is right

CodePudding user response:

The error code is GBK code, and you set the UTF8, wrong so

CodePudding user response:

Can only be set names' GBK '; Or the set names latin1, it can save Chinese, 2 set names utf8 alone cannot save, also don't know why;
It is better to set names' GBK ', so that can use utf8 when reading to read, more convenient; Otherwise will be shifted, very troublesome,

CodePudding user response:

The set names' GBK ';

CodePudding user response:

Inserted under Windows console only support GBK cannot be inserted utf-8, that is the reason why Windows console, the solution is to use GBK (if data is utf-8 without this method), the second is to use the graphical interface client to operation, using the Windows console without Linux system terminal does well, garbage bai, so work had better use the Linux system,

CodePudding user response:

DOS window coding issues

CodePudding user response:

Varchar field in the table is set to utf-8

CodePudding user response:

"Zhang SAN" corresponding GBK code is D5C5 C8FD, you are in the mysql console input is GBK code, you in another way, in other client set utf-8 try, such as navicate, or try using the JDBC in Java, or you put your this client input mode to utf-8
  • Related