About Korean data transfer in MySQL database

Source: Internet
Author: User

Korean encoding can be stored using UTF-8 or dedicated euc-kr encoding. In today's work, we need to transfer data from a Korean website to a local device for testing,

Then it is transferred to the database of another server. The mysql import and export tool is phpmyadmin Based on Web pages and php.

MySQL client version: 5.0.51a

MySQL Character Set: UTF-8 Unicode (utf8)

Apache/2.2.15 (Win32) PHP/5.2.13

PHP Extension: mysqli

Website data content: Korean and English, without Chinese data.

1. The export function of phpmyadmin exports Korean data from the website. We recommend that you save the exported data as zip or gzip. gzip is recommended;

2. Establish a local database, set the character set to UTF-8, finishing: utf-8-general-ci;

3. Use phpmyadmin to import the SQL file in the euc-kr character set format to the new database. In this case, you can browse Korean data;

4. You need to set the character set format in the code, because the default character set may not support correct display of Korean data on the webpage, and garbled characters may occur;

You need to set the character set of the client accessing the database and the character set of the result set returned to the client. For example, in php code:

Mysql_query ("set names euckr ");

Mysql_query ("set character set euckr ");

5. Set the default Character Set displayed on the webpage. Setting Method: <meta http-equiv = 'content-type' content = 'text/html; charset = euc-kr '>

Note: common character sets of web pages include: iso-8859-1 (English), gb2312 (Chinese), euc-kr (Korean) UTF-8, euc and so on.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.