Error establishing a database connection on *some* sites

What issue or error are you experiencing?

Instead of the website, I get the error message “Error establishing a database connection”. Sometime also “Error reconnecting to the database”.
Connecting to AdminerEvo does not work either, message: “Connection refused”
Other websites work.

When I want to change things in the settings, such as the PHP version, the site domain or the server, I get the following two error dialogs:

Title: "Uh-oh! Unable to start site."
Error: Command failed: /Users/jh/Library/Application Support/Local/lightning-services/mysql-8.0.16+6/bin/darwin/bin/mysqladmin ping
amysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/Users/jh/Library/Application Support/Local/run/VoDR7Uh9C/mysql/mysqld.sock' (2)'
Check that mysqld is running and that the socket: '/Users/jh/Library/Application Support/Local/run/VoDR7Uh9C/mysql/mysqld.sock' exists!

at ChildProcess.exithandler (node:child_process:422:12)
at ChildProcess.emit (node:events:517:28)
at ChildProcess.emit (node:domain:489:12)
at maybeClose (node:internal/child_process:1098:16)
at Socket.<anonymous> (node:internal/child_process:450:11)
at Socket.emit (node:events:517:28)
at Socket.emit (node:domain:489:12)
at Pipe.<anonymous> (node:net:350:12

and after that this dialog:


Titel: "Uh-oh! Unable to swap services."
Error: Command failed: /Users/jh/Library/Application Support/Local/lightning-services/mysql-8.0.16+6/bin/darwin/bin/mysqladmin ping
amysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/Users/jh/Library/Application Support/Local/run/VoDR7Uh9C/mysql/mysqld.sock' (2)'
Check that mysqld is running and that the socket: '/Users/jh/Library/Application Support/Local/run/VoDR7Uh9C/mysql/mysqld.sock' exists!

at ChildProcess.exithandler (node:child_process:422:12)
at ChildProcess.emit (node:events:517:28)
at ChildProcess.emit (node:domain:489:12)
at maybeClose (node:internal/child_process:1098:16)
at Socket.<anonymous> (node:internal/child_process:450:11)
at Socket.emit (node:events:517:28)
at Socket.emit (node:domain:489:12)
at Pipe.<anonymous> (node:net:350:12)

I have also tried to import a SQL-backup of the live website via the Duplicator plugin and the usual database values, but again the connection is refused, message:

Unable to connect the user **[root]** to the host **[localhost]** .
The server error response was: *Connection refused* '

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

Unfortunately, I can’t say what exactly led to this behavior.
However, I set up a new MacBook and used Local for the first time here.
But then why do many other websites work with Local?


System Details

  • Local Version:
    Version 9.1.1+6738
  • Operating System (OS) and OS version:
    macOS 15.1.1

Local Logs

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

It seems like something is damaged in this project, doesn’t it?

If there is no solution, what would be a recommended Word workaround? The database is basically still available through the live website, as are all the files.

Thanks for any hint!
Jugibur

EDIT: I tried to export the project, but unfortunately the app got stuck (waited about 2 hours)

Hi @Jugibur

It does seem like something specific with this site is causing trouble. Have you tried a manual import yet with the site’s contents instead of using a plugin? We have some steps for this here:

Manually Import a Local Site

Thank you so much for your fast reply, Nick-B!

I have now got the website working again using the recommended method.

However, it would be extremely helpful if you or your team could perhaps integrate some kind of repair function in future versions, as such a malfunction should not just happen in the app suddenly.
But at least I’m very happy that I can now continue working again, thanks again!

1 Like

Glad to hear you got things working @Jugibur! Thank you for your follow up and feedback. We’re always looking for ways to improve things for our users :green_heart:

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