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 a unified version of MySQL. Otherwise, you must change the SQL statement every time to restore the database to the server.