Solution for mysql to use the source command to import garbled characters in centos

Source: Internet
Author: User

Solution for mysql to use the source command to import garbled characters in centos

When I pass an SQL file to a remote server and want to import it to the database today, I found garbled characters, mainly due to incorrect encoding. I would like to record them to help future generations:

PS: it is best to first use yuminstallzipunzip to install the known pressure software on the remote server and then compress the SQL file to be uploaded into a zip file to the remote server for decompression, my SQL file is 20 GB, which is about 2 GB after compression.

Under centos:

# MySQL-u root-pmypass -- default-character-set = utf8/* root and mypass are user names and passwords */

Mysql> use dbname/* dbname indicates the name of the database to be imported */

> Source/root/data. SQL/* data. SQL indicates the SQL file you want to run */

// Red indicates the part to be entered.

Related Article

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.