Home > Database > Mysql Tutorial > body text

20140509-MySQL导入脚本文件,插入数据时显示乱码的解决办法_MySQL

WBOY
Release: 2016-06-01 13:14:49
Original
933 people have browsed it

20140509-MySQL导入脚本文件,插入数据时显示乱码的解决办法

打开CMD输入以下命令:

mysql –u root –p

然后输入密码:

在导入脚本文件之前,对字符编码进行设置:

charset gbk;

说明:上面的这条语句非常关键,这样不论你在cmd窗口,还是使用客户端输入中文,都能够正确保存了。

建议初学者不要使用SQLyog或者Navicat Premium等客户端连接工具。

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