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:
put this line
SET FOREIGN_KEY_CHECKS = 0;
just the beginning of databasefile_name.sql
.And put this line
SET FOREIGN_KEY_CHECKS = 1;
just before the end of file at last line offile_name.sql
.
Note: The first line will disable foreign key checks and the last line will enable it again.
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