Ubuntu14.04: Error: Unknown column ' AHSDFF ' in ' Field list '

Source: Internet
Author: User

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 '

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.