Home  >  Article  >  Database  >  MySQL5中文乱码解决_MySQL

MySQL5中文乱码解决_MySQL

WBOY
WBOYOriginal
2016-06-01 13:55:56881browse

  这是最近一个很挠头的MySQL5中文乱码问题的解决方法,尝试了多位网友的建议后总算解决,短短两句话,记录如下:

  1.编辑/etc/my.cnf ,在[mysql]段加入default_character_set=utf8

  2.在编写Connection URL时,加上?useUnicode=true&characterEncoding=utf-8参数

Statement:
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