Spring-mybatis return: Unknown column ' AHSDFF ' in ' Field list '
This kind of error is because the MyBatis character set is problematic and cannot store Chinese characters, my workaround is as follows:
One
sudo gedit/etc/mysql/my.cnf//On my computer, this sentence does not add "sudo" words no way to save the content of the changes
Or: VI gedit/etc/mysql/my.cnf//In the editing, to press "I", otherwise it can not be edited, edit do not tamper with the mouse wheel, do not hit a typo, press Enter is valid; press ESC, Exit VI Edit Interface, enter ": Wq", Save and exit the VI interface
Specific operation:
1.[client] Back add: Default-character-set=utf8
2.[MYSQLD] Back add: Character-set-server=utf8
3.[mysql] Back add: Default-character-set=utf8
Second, the terminal input: mysql-u root-p//into the database
1. Type show variables like ' char_% ';
If "Character_set_filesystem" value is "binary", the last folder location, the rest are utf8, then correct, if not correct, Baidu under how to do.
2. Type show variables like ' collation_% ';
If 3 records are: Utf8_general_ci, then correct, otherwise, Baidu changed
Third, if all successful restart MySQL, otherwise invalid, but this method is only valid for future libraries or tables, previously built libraries or tables, there is no way to correct, you can choose to change the previous table name, create a new table with the same name, when you build the table, it is best to specify the next default character is UTF8, although you can not do: Table name (...). ) Default CharSet UTF8;
Ubuntu14.04: Error: Unknown column ' AHSDFF ' in ' Field list '