MySQL import Chinese data garbled four ways to solve

Source: Internet
Author: User

Method One: Solve garbled problem by adding parameter--default-character-set = UTF8

Method One: Solve garbled problem by adding parameter--default-character-set = UTF8

Mysql-u root-p Password < path_to_import_file--default-character-set = UTF8

Method Two: Import garbled address in command line

Use database_name;

Set names UTF8; (or other required encoding)

SOURCE example.sql (SQL file storage path)

Method Three: Directly paste the code in the SQL file

Open the SQLyog client software;

Navigate to the SQL Editor and open the SQL file you just exported with Notepad;

Copy all the SQL statements in the file into the SQL editor and execute the SQL code;

method Four: Change the encoding format of the SQL file using Notepad or another text tool (If the method is not three, then try Method four)

Use Notepad (or UE) to open the SQL file you just exported;

Save this file--Open the Save As dialog box and select the encoding format for Unicode encoding in the dialog box;

Save the file, then CTRL + A, select all;

Copy the SQL statement inside the SQL encoder in SQLyog and execute the SQL statement again;

After the completion of the implementation remember to refresh, view the Chinese data table, garbled elimination, done;

MySQL import Chinese data garbled four ways to solve

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.