When we need to import table creation statements and data into a test or online database, the steps are as follows:
1. Export the development environment database (MySQL) Table structure;
2. Execute the exported sql file in the online database;
If the database management tool used is navicat during this period, sometimes you will encounter problems.
First export the table structure into a .sql file, and then execute the SQL file on the online server. An unknown error will be reported. Then you paste the SQL statement and execute it. There are no errors. At this time, you want to die. Yes.
Related recommendations: "Navicat for mysql graphic tutorial"
Cause of error: There is a problem with the encoding of the sql file exported by Navicat or the database selection.
Solution:
1. Export the required data table structure;
2. Create a new database, select characters and sort, and save the SQL file just now in the new database Execute it once, and then re-export it as a new SQL file, and it can be executed smoothly in other databases.
The above is the detailed content of What should I do if navicat reports an error when running SQL?. For more information, please follow other related articles on the PHP Chinese website!