linux mysql5.7 Chinese character set is not in the above set below the /mysql/my.cnf

Today you have the latest mysql, want to change the character set is utf-8 to prevent the Chinese insert garbled data, and consequently there is no my.cnf configuration file, change it's useless (manual laugh cry).

Correct posture:

1.vim edit /etc/mysql/mysql.conf.d/mysqld.cnf
2. [mysqld] add = Save character_set_server behind utf8 quit
3. # Service restart MySQL
4. Log mysql #mysql -u root -p after mysql> show variables like 'character%' to see if the coding have become utf8, if there is a failure latin coding.

Simple recording, prevent forgetting

Published 169 original articles · won praise 224 · views 260 000 +

Guess you like

Origin blog.csdn.net/sureSand/article/details/84660081