Mysql encoding problem resolution record in mac
When I used mysql, I was inexplicably unable to insert it into Chinese. Although I knew it was a coding problem, it took a long time to solve it. I will record it here.
1. Change the mysql program encoding:
Mysql encoding modification, Linux/Mac/Unix/General mysql encoding modification requires the myslq configuration file, which is in/etc/my. cnf, mac users do not have this file by default. You can find any my-*** In the mysql installation directory/support-files -***. copy cnf to/ect. copy it and change it to 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 and above can ensure the utf_8 encoding in the program, but there may still be problems and Chinese characters cannot be inserted. 2. view the database encoding, in workbench to re-Modify to utf-8-general-ci, may still not work. 3. Look at the specific data table, look at the collection attribute of varchar (), generally latin1, modify this to the utf-8-general-ci, perfect solution to the problem.