Learning database, the most frustrating is the character set of the problem, once a problem, there will be the impulse to smash the computer, especially after modifying a lot of character sets are still unsuccessful!
The database software I use is MySQL 5.1.28. When the problem started, it was this:
Scenario One: Each time the input (insert) command, always error, said a row of a row of errors, and then, I deleted the line, and then try, but, still error, but, the hint of the mistake is another line, until I will be the statement containing Chinese characters in the command of all deleted after the perfect pass, yes, is passed;
Scenario Two: Can be inserted in Chinese characters, no error, no warnings, each time with select Choose Table Content Display, no error, no warnings, but, read out the Chinese characters have become a question mark '? ';
It was only after I found the problem that I began to modify the character set with the alter that the teacher taught, but it didn't work. So I turned over the book and found a way to solve the problem.
First, you enter in the command line
Show variables like ' char% ';
This clause is used to query the current character set encoding. If you find out what's happening here,
Character_set_database:latin1character_set_results:latin1character_set_system:Latin1character_set_server: Latin1
So, next you'll enter the following command on the command line
Character_set_database: ' GBK ' character_set_server: ' GBK ' character_set_results: ' GBK ' character_set_system: ' UTF8 '
You can also change the GBK to UTF8, at which point the problem should have been resolved.
Just, maybe after reboot, the character set will not be restored, this is an unknown, anyway my is not ^_^
MySQL Character set garbled