Home > Database > Mysql Tutorial > body text

mysql数据库中文乱码解决方案_MySQL

WBOY
Release: 2016-06-01 13:48:21
Original
1294 people have browsed it

bitsCN.com

我们编写程序时,有时即使在jsp页面和代码中设置页面内容的编码为utf-8 OR gbk,但是我们在存储数据时,却发现数据库中的数据为乱码,问题是出现在数据库的编码问题。

在mysql中,我们打开mysql的安装目录,打开my.ini文件,找到如下引用:

default-character-set=latin1

这是mysql的默认编码,我们需要将起设置为UTF8 or GBK,,然后重启mysql,即可成功修改mysql的默认编码,再次存储数据时,数据乱码问题将得到解决。

 

bitsCN.com
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!