Unrecognized keyword (near "ON" at position 25) while importing a large data for WordPress
Home » BLOG » WordPress » Unrecognized keyword (near “ON” at position 25) while importing a large data for WordPress

Unrecognized keyword (near “ON” at position 25) while importing a large data for WordPress

category:  WordPress

Today I am working on my client’s website. The data is huge since the website is about the tours package. I want to clone the site to my localhost so I can audit the site.

How to export and import database to your localhost

  • Export the data(a sql file) via phpmyadmin from the server
  • Import the data(a sql file) via phpmyadmin at my localhost

While I am importing the sql file(~124MB), I receive the error below.

Error

Static analysis:

1 errors were found during analysis.

    Unrecognized keyword. (near "ON" at position 25)

SQL query: Edit Edit

SET FOREIGN_KEY_CHECKS = ON;

MySQL said: Documentation
#2006 - MySQL server has gone away

Edit the php.ini and my.ini

  • At php.ini, change the value as below.

max_execution_time = 600
max_input_time = 600
memory_limit = 1024M
post_max_size = 1024M

  • At my.ini, change the value as below.

max_allowed_packet = 1024M

  • Restart your web server

Php.ini is for PHP. You can find this file in your PHP folder such as “C:\xampp\php\php.ini“. It depends on what web server you use.

My.ini is for MySQL. You can find this file in your MySQL folder such as “C:\xampp\mysql\bin\my.ini“. It depends on what web server you use.

Recommend tool for import the large SQL file into your database

I normally use MySQL Workbench. It is easy to use. You can use a remote database as well.

That’s it for today. Hope it is helpful.