The following articles mainly describe the solutions for data recovery errors caused by inconsistent MySQL versions. This article describes related environments and errors, as well as the description of the actual solution, the following is the main content of the article, I hope you will gain some benefits.
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)
- PRIMARY KEY (`PID`) USING BTREE
- PRIMARY KEY USING BTREE (`PID`)
After the above modification, the execution will not go wrong.
Of course, it is best to install the unified MySQL version. Otherwise, you must change the SQL statement every time to restore it to the server.
Kaixuan's cnblogs
The above is an introduction to data recovery errors caused by inconsistent MySQL versions.