在百度上搜过一些方法:
比如 1. 设置my.ini 文件,但本人mysql5.6 解压包里面只有my-default.ini,在这个文件里面添加 default-character-set=utf8,但exit 退出数据库,重新登录还是没有用; 2. 直接在命令行语句中设置 set names gbk; 也没有用,并且在我退出数据库,重新登录后,关于字符编码的设置又恢复到原来的样子。
PHP中文网2017-04-17 14:44:35
Those settings cannot essentially solve the problem. The crudest method is to back up your database tables first, that is, export the sql file, uninstall the mysql database and then reinstall it. One step during the installation process is to set the encoding format. Once you set UTF-8, it won’t be garbled