Home > Database > Mysql Tutorial > body text

关于MySQL数据库韩文数据转移的问题

WBOY
Release: 2016-06-07 17:02:37
Original
1100 people have browsed it

韩文的编码可以采用utf-8或者是专用的euc-kr编码来存储。在今天的工作中,需要将一个韩文的网站数据转移到本地进行测试,然后转移

韩文的编码可以采用utf-8或者是专用的euc-kr编码来存储。在今天的工作中,需要将一个韩文的网站数据转移到本地进行测试,

然后转移到另一个服务器的数据库上。使用的导入导出mysql工具是基于网页和php的phpmyadmin。

MySQL 客户端版本: 5.0.51a

MySQL 字符集: UTF-8 Unicode (utf8)

Apache/2.2.15 (Win32) PHP/5.2.13

PHP 扩展: mysqli

网站数据内容:韩文和英文,没有中文数据。

1.phpmyadmin的导出功能导出网站韩文数据,建议导出保存为zip格式或gzip格式,推荐gzip;

2.建立本地的数据库,字符集设置为utf-8,,整理:utf-8-general-ci;

3.利用phpmyadmin工具将sql文件以euc-kr字符集格式导入到新建的数据库中。此时可以浏览到韩文的数据;

4.需要注意的时候,在代码中,需要设置好字符集的格式,因为默认的字符集也许不支持网页正确显示韩文数据,会出现乱码问题;

需要设置好客户端访问数据库的字符集和返回给客户端的结果集的字符集,例如在php代码下:

mysql_query("SET NAMES euckr");

mysql_query("SET CHARACTER SET euckr");

5.设置好网页默认显示的字符集,设置办法:

力⑨

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!