Navicat import sql file error

Scenario: More than 100 M sql files are imported into the local database and an error is reported, the local environment, phpstudy, error 1294 - Invalid ON UPDATE clause for 'create_time' column, error 2, 2006 - MySQL server has gone away

Reason for error 1: The MySQL version of phpstyudy is too low, the default is 5.5

Solution: upgrade mysql version

1: Back up the current database data, you can export the database file as a backup.

2: Backup the MySQL folder under PhpStudy in case the upgrade fails, and you can also use the old version of the database

3: Download MySQL5.6, unzip it, and put 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/"

These two addresses are changed to the mysql directory and database directory in their corresponding phpstudy.

5: Then run cmd as an administrator, enter the MySQL directory, as shown in the figure to indicate success, execute as follows:

Error 2 Reason: Exceeds the maximum packet allowed by mysql

solution

Add to my.ini (parameters according to their own needs)

max_allowed_packet=500M

wait_timeout=288000

interactive_timeout = 288000

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324838434&siteId=291194637