How to solve the Unknown command '\ n' error prompt when Mysql imports the database

Source: Internet
Author: User
Today, when I migrated a MySQL database, I always prompted: Unknown command '\ n', and I don't know where the problem is. After countless studies, the problem was solved, the following describes the specific ideas and solutions.

Previously, my MySQL database version was mysql4, And I imported the new database mysql5. I found that there was no problem in importing data between databases of mysql4, and no error message was prompted, however, an error occurred when importing data to mysql5. The solution is as follows:

You can specify the encoding when exporting the MySQL 4 database. The related commands are as follows:

Mysqldump-u root-P dbname -- default-character-set = GBK> D: \ htmer. SQL

Note: The above GBK encoding depends on the actual encoding of your database.

With the preceding export settings, You can import data to the new MySQL database without errors.

Link: http://www.htmer.com/article/874.htm

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.