How to set the character sequence set during MySQL Database Import or export

Source: Internet
Author: User
Tags mysql import

MySQL databaseIf you do not selectCharacter delimiter setGb2312, utf, or gbk may cause garbled characters. This article describes how to set the character collation set as follows:

Solution:

Start --> Run --> cmd --> enter the doscommand form: (if the command cannot be executed, put the installation path of mysql at the beginning of the path of the system variable)

Mysql Export command:

 
 
  1. Mysqldump-hlocalhost-P3306-uroot-p123456 -- default-character-set = gb2312 mysql> F:/pushingdb. SQL

Mysql import command:

 
 
  1. Mysql-uroot-p123456 -- default-character-set = gb2312 test <F:/pushingdb. SQL

Note: "root" indicates the database user name, "123456" indicates the database password, "mysql" indicates the database name, and "F:/pushingdb. SQL" indicates the location to which the database is exported;

In this way, through the above settings, we can avoid some garbled characters in the MySQL database.

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.