Database error - can't export

What issue or error are you experiencing?

Trying to export the website, it fails exporting the database.

The local.sql file is stuck as a tmp file too
And this shows in adminer

The log file is here, I see it’s doing a crash recovery each time.

I’m trying to move the database to another server


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


System Details

  • Local Version: Version 8.1.0+6514

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


Local Logs

Attach your Local Logs here (Help Doc - Retrieving Local’s Log)

local-lightning.log (234.4 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.

In the logs, I’m seeing this error, which doesn’t give us much to go on:

{"level":"error","message":"Error: mysqldump exited with non-zero exit code: 2\n    at SiteDatabaseService.<anonymous> (%%appPath%%\\main\\sites\\database\\SiteDatabaseService.js:1:2698)\n    at Generator.next (<anonymous>)\n    at s (%%appPath%%\\main\\sites\\database\\SiteDatabaseService.js:1:849)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","thread":"worker","timestamp":"2024-01-08T15:10:26.909Z","worker":"exportSiteWorker"}

If you access the site in the browser, does it still work? For example, are you still able to see pages and navigate the site?

If you can interact with the site still, you might try manually exporting the DB using the site shell. To do this:

  • Click the “Open site shell” button on the Local site over view page
  • In the terminal that opens, export the DB running this command:
wp db export

Can you let me know if the site still works as well as what happens when running the wp db export command?

1 Like

Thank you.

Yes when I go to the website, everything is working perfectly. All plugins work, all users are there, etc

When I opened the shell prompt, I got this

G:\localsites\esmedia\app\public>wp db export
‘grep’ is not recognized as an internal or external command,
operable program or batch file.
Warning: Failed to get current character set of the posts table. Reason: ERROR 2003 (HY000): Can’t connect to MySQL server on ‘localhost’ (10061)

mysqldump: Got error: 2003: Can’t connect to MySQL server on ‘localhost’ (10061) when trying to connect

Had some success. I used a plugin (ai1wm) on the localwp site to do a backup and then imported it to the new wordpress server. All info seems to have been transferred across.

2 Likes

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