With the MySQL time, inexplicable wonderful insertion does not enter the Chinese, although know that must be the problem of coding, but it took a long time to solve it, the record here.
1. Change the encoding of the MySQL program:
MySQL modified the code, linux/mac/unix/Universal modified MySQL encoding needs to use the MYSLQ configuration file, the file in/etc/my.cnf,mac user default is not this file, you can go to the MySQL installation directory/ Support-files find any one my-***.cnf copy to/ect, pay attention to copy over to change the name of my.cnf! Then: add default-character-set = UTF8 under [client] and add the following three lines under [mysqld]: Default-storage-engine = INNODB character-set-server = UTF8 Collation-server = utf8_general_ci above can guarantee the program Utf_8 encoding, but there may still be a problem, can not insert Chinese. 2. Check the encoding of the database, Workbench to Utf-8-general-ci, may not be. 3. Look at the specific data sheet, see the collection property of varchar (), General is latin1, this also modified into utf-8-general-ci, perfect solve the problem.
MySQL code problem resolution record under Mac