Home > Database > Mysql Tutorial > utf-8-xmapp中mysql的默认字符集的修改问题

utf-8-xmapp中mysql的默认字符集的修改问题

WBOY
Release: 2016-06-06 09:37:45
Original
1874 people have browsed it

utf-8mysqlxamppunicode

在机器上装了xmapp时,并没有提示要为mysql设置字符集。
使用如下命令发现。
show variables like '%char%'

结果如下:
Variable_name Value

character_set_client utf8mb4
character_set_connection utf8mb4
character_set_database utf8
character_set_filesystem binary
character_set_results utf8mb4
character_set_server latin1
character_set_system utf8
character_sets_dir C:\xampp\mysql\share\charsets\

发现很多都不是utf8

后来在网上看到很多的朋友说可以在my.ini加上类似下面的设置。
character_set_client=utf8mb4

结果设置了后,mysql会重启失败。

最后查看了my.ini
发现有如下几句。

UTF 8 Settings

#init-connect=\'SET NAMES utf8\'
#collation_server=utf8_unicode_ci
#character_set_server=utf8
#skip-character-set-client-handshake
#character_sets-dir="C:/xampp/mysql/share/charsets"

把它改为
#init-connect=\'SET NAMES utf8\'
collation_server=utf8_unicode_ci
character_set_server=utf8
#skip-character-set-client-handshake
#character_sets-dir="C:/xampp/mysql/share/charsets"

重启后可以成功,


这是不是说明这种设置不能随便加,只能按照已有的项来修改?

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template