mysql中通过my.cnf设置默认字符集utf-8
- [client]
- default-character-set=utf8
-
- [mysql]
- default-character-set=utf8
-
- [mysqld]
- init_connect='SET collation_connection = utf8_unicode_ci'
- init_connect='SET NAMES utf8'
- character-set-server=utf8
- collation-server=utf8_unicode_ci
- skip-character-set-client-handshake