Error establishing database connection


#1

Randomly started having an issue with my site today where it just gives me
“Error establishing database connection”

Heres what I’ve done so far.

Removed and reinstalled Local to the latest version.
Removed and reinstalled Virtual Box to the latest version.
Removed Virtual Box Instance.
Restarted site multiple times.
Checked WP prefix
Checked that user / pass / host info correct in config file.

Still no luck.

Any help would be appreciated.


#2

Hey @edowns

Are there any errors in the logs/mysql/error.log file?

You can zip up the logs folder for this site and attach it here for us to look and see if there is anything going on.

Can you also please provide your local-by-flywheel.log file? See
How do I retrieve Local’s log file?” for instructions on how to do so.

– Ben


#3

Archive.zip (34.9 KB)

You bet see attached.

Thanks Ben


#4

One thing I noticed in the meantime is the port for my site and whats listed on local are not the same.


#5

Same issue started yesterday, Error establishing a database connection.

Using Local version 2.4.2

Archive.zip (33.1 KB)


#6

Had same issue after upgrading to 2.4.2. I noticed that sites that used ‘root’ for user weren’t affected. Changed affected sites user and password to root in wp-config and fixed!


#7

Hey @edowns

From the lines in the Local log it looks like somehow the way that the site is mounted isn’t working. Here’s an example of some of those lines for reference:

 Sep 28, 2018, 5:34 PM CDT - warn: [main/docker-machine-fdv] unfsd stderr:  bind: Address already in use
Couldn't bind to udp port 60983

I would try toggling “Faster Docker Volumes” from “Preferences > Advanced”.

– Ben


#8

Hey @vinhost

It looks like your issue is different than edowns’ issue.

From the looks of things, something is crashing the database. I would recommend trying to restore the site from a backup, or from the files within the folder like what is outlined here: How can I restore a site from a Local site folder?

– Ben


#9

@ben.turner Hello, I have the same problem and I did not succeed following what has already been said in this topic. I am also not able to back up the site, it gives error message.

Can you help me please?

error.zip (366.6 KB)


#10

Hey @sandrodelmonte

I’m seeing a bunch of errors that look like this:

2019-02-10T13:52:31.568742Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 4618136
2019-02-10T13:52:31.568928Z 0 [ERROR] InnoDB: Ignoring the redo log due to missing MLOG_CHECKPOINT between the checkpoint 4617569 and the end 4618136.
2019-02-10T13:52:31.569061Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2019-02-10T13:52:32.172803Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2019-02-10T13:52:32.173042Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2019-02-10T13:52:32.173184Z 0 [ERROR] Failed to initialize builtin plugins.
2019-02-10T13:52:32.173336Z 0 [ERROR] Aborting

That definitely seems like an issue with the database, possibly from some sort of issue with the site not being shutdown properly before losing power, or another event that crashed the database.

I’ve never seen that specific error message, but I Googled [ERROR] InnoDB: Ignoring the redo log due to missing MLOG_CHECKPOINT and there were a number of pages with information about this. This StackOverflow message looks the most promising: https://dba.stackexchange.com/questions/163445/innodb-ignoring-the-redo-log-due-to-missing-mlog-checkpoint

That being said, if you do have a recent backup of the site, it might be easiest to import the backup and continue working on the site.

– Ben