Mysql unknown command '\ "' Problem Solution

Source: Internet
Author: User

The original server environment uses windows, and then the database backed up by mysqldump cannot be imported into the database in linux. Import always appears:

Unknown command '"'

Therefore, if you replace all with ', the result still does not work and cannot be imported.

However, you can directly copy the database files. Copy the file before dumping it in dump. The results are the same.

Unknown command '"'

Depressing.

After export and import, it is found that mysql is installed by default using utf8 encoding, while mysql gbk database is installed on my local machine. In this way, a format error may occur when the backup file is restored.

Later, during dump, specify the character set mysqldump and add a parameter-default-character-set = gbk to import the backup file again. Everything went fine.

Mysqldump-u root-p-opt-allow-keywords-default-character-set = gbk databases>/PATH/XXX. SQL

Non-default character set. When importing and exporting data, specify the corresponding character set.

 

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.