(1) Nonsense is not much to say is the use of MySQL database when you can not input Chinese, the input of Chinese after the display is garbled!!
(2) Don't say it! Start solving the problem!
First step: Find the directory where MySQL is installed to find the My.ini file;
The second step: Use Notepad to open the My.ini file, find this place to see if Default-character-set is UTF8 is not the case instead of UTF8 can! (The previous version may not have this sentence directly added to the good!) )
# MySQL Client library initialization. [Client]port=3306[mysql]default-character-set=utf8
Step three: Enter in MySQL database cmd: show variables like '%char% '; View the encoding format of the database! This shows the picture, etc. will show the picture is changed!
The fourth step: Change the original database encoding method:
Set Character_set_database=utf8;set character_set_server=utf8;set character_set_client=gbk;set character_set_ CONNECTION=GBK;
Fifth step: Change the encoding mode:
Sixth step: Insert Chinese data to try! Ok! It can be plugged in!
Seventh Step: Resolve the garbled characters shown in the first picture when the select * from table is resolved
Change the coding method above! Set CHARACTER_SET_RESULTS=GBK; You can display it normally!
(3) The above has been described in detail the solution! But we need to note that sometimes when we join the data, we should follow the "fourth step" "Seventh step" to solve the problem of input and display garbled!
Notable is: When we use MyEclipse, provide the DBBRowser will not appear garbled time!
Ok! I wish you success!
Solve the problem that MySQL cannot insert Chinese data and display garbled after inserting "pro-Test text commentary!" The