Scenario: Importing more than 100M sql files into the local database and error reporting, local environment, phpstudy, error reporting one: 1294 - Invalid ON UPDATE clause for 'create_time' column, error reporting two: 2006 - MySQL server has gone away.
Related recommendations: "Navicat for mysql graphic tutorial"
Error one reason: phpstyudy's mysql version is too low, the default is 5.5
Solution: Upgrade the mysql version
1. Back up the current database data. You can export the database file as a backup.
2. Back up the MySQL folder under PhpStudy in case the upgrade fails. You can also use an older version of the database.
3. Download MySQL5.6, unzip it, and place it in the MySQL folder under PhpStudy.
4. Copy a copy of my-default.ini, rename it to my.ini, open my.ini and add:
basedir="E:/phpStudy/MySQL/" datadir="E:/phpStudy/MySQL/data/"
. Change these two addresses to your own. The mysql directory and database directory in phpstudy.
5. Then run cmd as an administrator and enter the MySQL directory. As shown in the figure, it indicates success. The execution is as follows:
Error Second reason: Exceeding the maximum data packet allowed by mysql
Solution:
Add to my.ini (parameters are based on your own needs)
max_allowed_packet=500M
wait_timeout=288000
interactive_timeout = 288000
The above is the detailed content of How to solve the error when navicat imports sql. For more information, please follow other related articles on the PHP Chinese website!