I'm the gatekeeper of my own destiny

导航

xampp3.2下mysql中文乱码终极解决方案

xmapp3.2.2中mysql已经被替换成了Mariadb,网上那些显示char语句已经失灵。

另外本文主要介绍的是手动在mysql中写入中文乱码问题

那么我们将采用如下三个步骤解决乱码问题

1.打开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"

[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates
default_character_set=utf8

 

2.将数据库本身改为utf-8

  

3.将表和字段改为utf-8

  

然后在手动写入中文,一切OK

posted on 2016-03-11 17:31  Wishbay  阅读(1015)  评论(0编辑  收藏  举报