Error on DB import: "Error: Failed to get current SQL modes. Reason: ERROR:"

What issue or error are you experiencing?

When using manual import instructions to import SQL of a site backup, I receive the error “Error: Failed to get current SQL modes. Reason: ERROR:”

(Note: “ERROR:” is not a copy-paste error, there is no further detail.)

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

Fully repeatable by follwoing instructions to import SQL as outlined here: Import/Export a WordPress Site - Local

System Details

  • Local Version: Version 10.1.1+6939

  • Operating System (OS) and OS version: Windows 11


Local Logs

Nothing is logged.

FURTHER NOTES:

I could manually export the database from my host and manually import it using AdminNeo; what I’m hoping to determine is whether there’s a way to use the host’s manual backups and the recommended site import process, instead of inventing my own import process from scratch.

Confirmed that it’s possible to import for THIS SITE using AdminNeo. However I’d still like to understand how to do it the “normal” way, as our production database is an order of magnitude too large to import using that method. I can only do this with our staging website because it’s been 3 years since we rebaselined the database vs live & the staging database is tiny.

Hi @ebscoles!

We have a Windows Troubleshooting guide below that goes over some common items worth checking. For example, ensure that Local is running as an administrator, that there are no security blockers, and that Local has access to update the Hosts file.

Sometimes these items can prevent normal functionality on your system.

Thanks; I’ve reviewed all those issues & confirmed that non apply in this case.

How large is your production DB @ebscoles?

Oh it looks like it might not be as big as I feared, only about 250MB. Looks like host’s backup method omits caches & indexes. Anyway, would still be great if I could figure out how to make this work from command line.

@ebscoles, could you try this?

Find Local’s MySQL executable (usually something like C:\Users\[user]\AppData\Local\Local by Flywheel\resources\mysql\bin\mysql.exe on Windows), then run:

mysql -u root -ppassword local_dbname < path/to/dump.sql

That might help pinpoint where the issue is for further troubleshooting!

I don’t know enough command line SQL to understand what you’re asking me to do. What’s dump.sql & why am I piping it into mysql after I’ve loaded the current site’s database? Where does the path to the mysql executable go in that command line?

Ah, I get it: mysql executes the SQL in the import file (dump.sql). so in this case the command line is:

mysql -u root -ppassword local < .\4889cc.sql

That seems to execute the import without error.

So this looks like an adequate workaround; I’m fine with you all marking this as a solution but I’m still curious why the wp command line import tool is failing.

Thank you for testing that @ebscoles! Glad that worked as an alternative.

You mentioned not seeing anything in the logs when you posted. Do you know which log you checked? There are some different ways to access and share Local Logs. For us to be able to troubleshoot thoroughly, please click the Download Local Logs button from the Help menu drop down 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.

This is the log I was looking at: C:\Users\[user]\AppData\Roaming\Local\local-lightning-verbose.log

That seems to be at the scope of the entire Local application. The more I think about it, the more I realize I wouldn’t expect it to record events resulting from a site shell session. Would it normally?

What logs would you want us to look at?

I don’t see a help menu. There’s a help submenu from the top level hamburger, but its only option is ‘Community.’

Again, Version 10.1.1+6939 on Windows if that explains anything for you.

@ebscoles

Sorry, I didn’t notice your Local version. On your version, you’ll click on the question mark on the left-hand side of the app. Scroll down and you’ll see a Download Local Log button. Click that, and it will create a zip archive containing several local logs and info bundled together.

With Local v10.1.2, we have made this Download Local Log option easier to find from the menu, so when you upgrade, you’ll see it there.

Right, I’m looking at them now.

My recollection is that I did a retest immediately before clicking submit on the first message in this thread, so sometime within the 10m or so before 2026-09-01T19:27.

Possible it could be caused by a deprecated character set causing mysql.exe to crash? That’s all I’m seeing that looks suspicious, but:

  • it’s only a warning
  • I can’t be sure it matches time of the test failures.

local-logs1.zip (48.5 KB)

Are you using XAMPP as well @ebscoles? It looks like from the Router log there have been ongoing connection errors. Sometimes running multiple developer applications simultaneously can cause conflicts as they compete for access and resources. Specifically, this means the database import issue could be due to port conflicts, which cause the database connection to fail or behave erratically during imports.

If you wanted to try again, some simple steps would be:

  1. Completely stop XAMPP (if it’s running)
  2. Restart Local
  3. Retry the import

Using no other local development environments. This is a relatively clean workstation, only been using it for about a year, so there’s not a lot of cruft on it.

One thing I had forgotten: I am running Maria as a service. If I try this again, I’ll stop that service first. (Only running Maria, it’s not used with any web environment. I’d explain why but you don’t need that cluttering your brain.)

That said, connection errors are plausibly due to admin restrictions on the workstation. It was locked down pretty tight before I was granted local admin access & I haven’t tried to un-do any of that which I didn’t need to.

Thanks for the clarification @ebscoles!

I was seeing this error repeating in your log which is why I brought it up:

2026/09/02 21:29:17 [error] 41204#42968: *3256 connect() failed (10061: No connection could be made because the target machine actively refused it) while connecting to upstream, client: 192.168.228.6, server: gccplanning.local, request: "GET /xampp/cgi.cgi HTTP/1.1", upstream: "http://127.0.0.1:10029/xampp/cgi.cgi", host: "GCCS-22534.genesee.edu"

Well that is interesting. A site of that name exists in my Local but I never actually imported anything for it - it’s just a vanilla Local install. & as far as I can tell I’ve never even downloaded xampp on this system.

You mentioned that the device was pretty locked down, and these errors certainly could still be pointing to some type of blocker happening from security or a permission setting. So it might be worth checking those later if you run into more trouble.

No connection could be made because the target machine actively refused it

Going back to the original error you received when importing, have you tested with any other sites? Curious if it continues to happen for any import or only the site you originally tested.