I’m running PhpMyAdmin locally through Laravel Valet with a MySQL server (8.0.27) through DBngin, and I sometimes got this error while importing databases:

Bash
Error
Static analysis:

1 errors were found during analysis.

Missing expression. (near "ON" at position 25)
SQL query: Copy Edit Edit

SET FOREIGN_KEY_CHECKS = ON;

MySQL said: Documentation

#2006 - MySQL server has gone away

I researched increasing the sql server timeout in .cnf files, memory limits, forcing “foreign_key_checks” off/on, and importing small databases, but nothing worked.

Thanks to a handy tip from my coworker – the fix was to upgrade my DBngin MySQL server from 8.0.27 to 8.0.33.

That fixed the issue and I could now import my databases!

DBengin has a handy feature to turn databases on/off.

Note: It did mean with a new MySQL server I had to migrate my databases across to it.

You could also use homebrew to manage your MySQL server.

Comment

Note: Comments are moderated, URLs not permitted.