Problem: I will be the CSV file using the load data function (already converted to utf8 - CSV format) into my new table mytable, then select * from mytable can query to all the lines, but according to the field the query select * from mytable where col. The name='XXX' when there is a problem: if the col. The data in the name field is numeric or text type, the query returns the eligible records; If col. The data in the name field is English string, there is no record returned, although list
There is conforms to the query conditions,
Reason: the younger brother online for a long time and a lot of similar problems are not carried out in accordance with the field data for Chinese query, but I was not carried out in accordance with the field data for English query, really have a headache, and whether the CSV file's data encoding format is not fully converted to utf8 format, leading to the new table corresponding field do not agree with the data encoding format?
With the show variables like 'character_set_database';
Looked at the mysql database and table encoding formats are utf8 format, don't know where the problem is, please master answer, thank you!!!!!
Variable_name Value | |
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - | -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - |
Character_set_client | utf8 |
Character_set_connection | utf8 |
Character_set_database | utf8 |
Character_set_filesystem | binary |
Character_set_results | |
Character_set_server | utf8 |
Character_set_system | utf8 |
Character_sets_dir | C: \ Program Files \ MySQL \ MySQL Server 5.7 \ share \ charsets \ |
CodePudding user response:
What is check the field type, field space savedCodePudding user response: