set foreign_key_checks = on error wordpress set foreign_key_checks = on error wordpress wordpress wordpress

set foreign_key_checks = on error wordpress


This Error, Mostly We get while importing the database from PhpMyAdmin. I solved it by importing database through commands.

mysql -u username -p database_name < file_name.sql

or by changing in database file_name.sql as:

  1. put this line SET FOREIGN_KEY_CHECKS = 0; just the beginning of database file_name.sql.

  2. And put this line SET FOREIGN_KEY_CHECKS = 1; just before the end of file at last line of file_name.sql.

Note: The first line will disable foreign key checks and the last line will enable it again.

How to import an SQL file using the command line in MySQL?


once it happened to meIt's because you've been using MariaDB 10.3 and now you changed the version to lowertake a backupchange or update/upgrade the version of your mariadb or mysql to the latest and then it will be ok


After checking lots of solutions finally i found the correct one, my wordpress database size was 100mb.

Changing php.ini at C:\xampp\php\php.inimax_execution_time = 600max_input_time = 600memory_limit = 1024Mpost_max_size = 1024Muser_ini.cache_ttl = 15000
Changing my.ini at C:\xampp\mysql\bin\my.ini</b>max_allowed_packet = 1024M