Home > Database > Mysql Tutorial > body text

MySQL数据库:完美解决中文数据乱码_MySQL

WBOY
Release: 2016-06-01 13:01:17
Original
1034 people have browsed it

首先声明:这是解决我的问题的方法,个人笔记,仅供参考。

环境:win server 2003 + MySQL5.0 + Navicat 10

问题现象:通过Java WEB 页面提交数据到MySQL数据,发生中文乱码,每个汉字显示为?号,例如:“标题1”显示为“??1”。

解决方法:找到MySQL5.0安装目录下编辑打开my.ini文件,修改为:

[client]


port=3306


[mysql]


default-character-set=utf8

# The default character set that will be used when a new schema or table is
# created and no character set is defined
default-character-set=utf8
Copy after login

注意:有两个地方要修改为 utf8.

\

\

然后修改数据库的属性为:
\

问题解决了,就这么easy!

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