MySQL Import Database error #1064 prompt solution

Source: Internet
Author: User
Tags import database mysql import mysql import database phpmyadmin

When you use SQLyog to export a dedecms database as a xxx.sql file, several errors are reported:

Error 1064 online 21: You have an error in your SQL syntax. Check manual t hat corresponds to your MySQL server version for correct syntax, use near ' DEFAULT Charset=utf8 online

The first is a USING btree error. You have a error in your SQL syntax; Check the
Manual that corresponds to your MySQL server version for the right syntax to use
Near ' using Btree,unique KEY ' Pkey ' (' Pkey ') USING btree ...

Solution:

The code is as follows Copy Code

UNIQUE KEY ' Pkey ' ("Pkey") USING Btree, modified to

The UNIQUE KEY ' Pkey ' USING btree ("Pkey"),

The using Btree is placed in front of the index field.

Second, some of the fields in the dedecms with the MySQL system to retain the field conflict, and SQLyog exported data SQL file SQL statements in the Insert field has no symbol "'", so will conflict.


Select a database within phpMyAdmin and browse its table list to see the collation (collation) information of the table. For example, the collation information for a database table is gbk_chinese_ci, so before you export the database as a SQL script, select "Chinese-chinese simplified" in the phpMyAdmin Home language (language) column. Do not choose "Chinese-chinese simplified-gb2312", otherwise the exported SQL file in Chinese will appear garbled phenomenon. This sentence is absolutely the key, I just follow this and then OK.

Similarly, the table's collation information is gb2312_chinese_ci, so before you export the database to SQL script, in the phpMyAdmin home page language (language) column select "Chinese-chinese simplified-gb2312 ", so that the exported SQL script Chinese will not appear garbled.

When importing the above exported SQL script, enter the phpMyAdmin home page to see the "MySQL Character set" information, such as "UTF-8 Unicode (UTF8)", the "file's character Set" select "UTF8" when importing the aforementioned SQL script.


If it is dedecms, direct data import can be exported directly using DEDEDMS

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.