Can't import database via Adminer nor via site shell

What issue or error are you experiencing?

I’m trying to import a site to Local manually.

I already:

  1. Created a blank site on Local
  2. Replaced the wp-content folder with the new one

The issue is the database import. I exported the database from the site I want to import, which is a 175 MB .sql file. Here is what I’ve tried:

Adminer
If I try to import it via Adminer, I get a memory error:

Fatal error : Allowed memory size of 268435456 bytes exhausted (tried to allocate 183724600 bytes) in C:\Users*\AppData\Local\Programs\Local\resources\extraResources\adminer\adminer.php* on line 100

I already increased the memory_limit on php.ini to 3000M and I still get the same error.

Site Shell

I pasted the .sql file on the /public folder and ran the following command on the siteshell (local.sql is the file name of the db I’m trying to import):
wp db import local.sql

When I run it, I get this error: Error: Failed to get current SQL modes. Reason: ERROR 2003 (HY000): Can’t connect to MySQL server on ‘localhost’ (10061)


What steps can be taken to replicate the issue? Feel free to include screenshots, videos, etc


System Details

  • Local Version: Version 8.2.1+6583

  • Operating System (OS) and OS version: Windows 11 Home version 22H2


Local Logs

Attach your Local Logs here (Help Doc - Retrieving Local’s Log)
local-lightning.log (246.1 KB)


Security Reminder
Local does a pretty good job of scrubbing private info from the logs and the errors it produces, however there’s always the possibility that something private can come through. Because these are public forums, always review the screenshots you are sharing to make sure there isn’t private info like passwords being displayed.

I managed to solve it using this workaround: PHP memory limit error when importing / Failed to get current SQL modes. Reason: ERROR 2003 (HY000) - #13 by buzztone

1 Like

@ams221 Glad to hear you got things fixed up! Thank you for sharing the solution here for others. :green_heart:

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.