Data Recovery error due to inconsistent MySQL versions

Source: Internet
Author: User

Environment 

The MySQL version installed on my local machine is 5.1.30

The installed versions on the server are 5.1.7 and 5.0.22.

 

Error 

Back up SQL statements on the local machine and execute them on the server. An error is always reported during execution:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL Server version for the right syntax to use near 'using btree...

 

Solution 

Found by exploring the data

Change the SQL statement similar to the following statement (red border) to the following statement (blue border)

  1. Primary Key ('pid ') using btree
  1. Primary key using btree ('pid ')

After the above modification, the execution will not go wrong.

Of course, it is best to install a unified version of MySQL. Otherwise, you must change the SQL statement every time to restore the database to the server.

 

 

 

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.