So I need to import a sqldump.sql or better said update the existing one. I went the route suggested
because I get a fatal error in Adminer (the db is just 140mb in size…)
Fatal error : Allowed memory size of 268435456 bytes exhausted (tried to allocate 150604992 bytes) in C:\Program Files (x86)\LocalWp\resources\extraResources\adminer\adminer.php on line 98
So I did the following:
Copy the sql file to the site root. That location should be something like:
Right-click on the site in Local and select “Open site shell”
Within the terminal that opens, import the sql file using this command:
wp db import name-of-sql-file.sql
And I’m getting this what ever I do:
Error: Failed to get current SQL modes. Reason: ERROR 2003 (HY000): Can’t connect to MySQL server on ‘localhost’ (10061)
What I’m doing wrong?
We would be happy to assist with your Local troubleshooting! Could you provide some more details to help us take a further look?
Keep us posted and we’d be happy to help further!
I’m having the same exact problem. Same exact process and same exact error.
OS: Windows 10
Local version: 8.1.0+6514
Are you able to manually import the DB using steps like what Ben mentioned here?
That error is basically saying that PHP (the underlying software running Adminer) didn’t have enough memory to handle the upload of that SQL file.
Are you able to import the site by creating a zip of the sql file along with the wp-content folder? Something like what’s outlined in the “Restoring From Only Local Site files” section of this help doc:
If you do need to manually import the database of a large SQL file, I rec…
That documentation contains the same process that the original poster and I both used which produced the error.
I am just trying to import the database into the site where I have cloned my code base repository. I don’t need to import wp-content, just the database. Please help.
Here is a related Stackoverflow thread for Windows users experiencing the same error that seems to have some solutions shared:
This doesn’t really help. We’re following the exact steps you folks recommend in your documentation and it’s not working. Can your team help us understand how we can get past this error? We can’t be the only folks that have faced this error.
I’m getting a similar error while doing this request at
Adminer Memory Exhausted - Windows 11.
Operating System (OS) and OS version:
Windows 11 Pro
@tnaughton , however, the error is fairly generic so it’s tough to pinpoint. It could be related to something specific in your machine/OS and not necessarily a setting within the Local app. As noted in the link I shared there could be a handful or several different reasons for it.
In order for us to take a deeper look could you share your Local Log? For us to be able to troubleshoot thoroughly, please click the
Download Local Logs button from the
Support tab in Local. This will generate a zip archive that contains the Local log along with some other diagnostic information to help quickly zero in on any issues that Local is encountering.
Continuing the discussion from
Adminer memory exhausted:
I’m getting this error on a blank WordPress install.
What issue or error are you experiencing?
Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 130023456 bytes) in C:\Users..\AppData\Local\Programs\Local\resources\extraResources\adminer\adminer.php on line 98
What steps can be taken to replicate the issue? Feel free to include screenshots, videos, etc
Importing 26.7 MB sql.gz database created by WP Migrate Lite
local-logs.zip (79.3 KB)
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.
No - I’m getting the following error.
Site is started in Local & operating as expected.
Database created by WP Migrate Lite added at App>Public
@buzztone - I merged your thread in here just to keep all troubleshooting and comms in the same place.
As mentioned, there could be different culprits potentially for this same error.
With Windows it’s always a good idea to just perms and privileges:
Thanks for the feedback, Nick!
After you pointed out the logs mentioned Operation Not Permitted, I realized I probably knew the answer. Windows runs applications with less privileges by default. My suspicion is that this caused the error!
I then went to the Start Menu or start search bar, searched for Local, then right-click and “Run as administrator” to open the application with full privileges. Magically, the import process starts!
I wonder if others on this forum complaining about Windows …
There is also a workaround mentioned Ben here that might work as well:
It looks like this is a bug with how Local is setting up the shell environment.
As a work around, you can manually update the wp-config.php for the site to include the port number for the database:
I’ll file a bug with the Local bug tracker so that we can get someone to look into and fix this!
@Mike8040 or @tnaughton If you’re still having issues please share your Local Logs and we can try and take a further look.
I tried this workaround & was able to import the 486 MB sql database file created by WP Migrate Lite.
Found Local Database Port
Edited Local wp-config.php for this site
Imported Database with wp db import your-database-filename.sql
Thank you for the followup
@Mike8040 and @tnaughton that might be a good workflow to try next if you’re still having issues!
I’m glad of the assistance in solving my current problem but surely this is a bug.
wp db import your-database-filename.sql from the Local Site Shell the Local Database port is not correctly identified.
Importing an existing website database is documented at
Import/Export a WordPress Site - Manually Import a Local site. But this clearly often does not work on Windows computers.
Local Shell uses port 10061
Local Database port is different
Fixed by following Workaround
This can be fixed by following this
Workaround where the actual Local Database port is added in the Local site’s wp-config.php file.
If the Local Site Shell was able to correctly identify the Local Database port on Windows computers, this particular problem would be eliminated for Windows users.
@buzztone - You are correct. I checked and we do have a bug filed going back to this comment from Ben that I shared earlier. I’ll send a note to the dev team that you and others have been coming across this again.
@Nick-B sorry for showing my frustration. I appreciate your team getting back to us. I followed the steps from buzztone and was able to load one one my sites. Thanks again.
Glad to hear it
@tnaughton! Thank you for the follow up here. @Mike8040 let us know if you still have any issues or if that workaround fixes things up on your end as well.