Unable To Connect- Error Establishing A Database Connection

Hi! Fairly new to local and I am having trouble connecting to my site. When I log into my flywheel dashboard and click the “site-name.flywheel.com” I can access it, but when I open it from local (site-name.local) I get “Error establishing a DB connection”

I’ve tried support which wasn’t really helpful, and I’ve even tried changing the .local domain to .flywheel.com and nothing has worked.

I just worked on it Friday and pushed it to flywheel, and when I came back today I’m getting this error message. I haven’t changed anything on my account or the site so I’m not really sure what to do from here. Any advice? Thank you!

Hey @sarahhamon,

I’m using Local for the first time too and came across this error.

First things to try are making sure the site is “running”

See in this screenshot it says “start site”. click that if it isn’t running.

This is what it looks like when it’s running. With mine I had to wait a short time after starting it for the mysql server that Local uses to be running. Once I waited patiently it all worked for me.

Hopefully this is helpful :slight_smile:

Thanks! My site was running when this issue occurred until I finally just shut the whole thing down.

I have just started getting this issue on a new site I have set up in Local. Here’s an excerpt from the log:

Feb 20, 2019, 8:51 PM GMT+9:30 - info: [main/docker-machine] Starting "local-by-flywheel"...
Feb 20, 2019, 8:51 PM GMT+9:30 - info: [main/docker-machine] (local-by-flywheel) Check network to re-create if needed...
Feb 20, 2019, 8:51 PM GMT+9:30 - info: [main/docker-machine] (local-by-flywheel) Waiting for an IP...
Feb 20, 2019, 8:52 PM GMT+9:30 - info: [main/docker-machine] Machine "local-by-flywheel" was started.
Feb 20, 2019, 8:52 PM GMT+9:30 - info: [main/docker-machine] Waiting for SSH to be available...
Feb 20, 2019, 8:52 PM GMT+9:30 - info: [main/docker-machine] Detecting the provisioner...
Feb 20, 2019, 8:52 PM GMT+9:30 - info: [main/docker-machine] Started machines may have new IP addresses. You may need to re-run the `docker-machine env` command.
Feb 20, 2019, 8:52 PM GMT+9:30 - info: [main/set-docker-env] Getting Docker Machine env.
Feb 20, 2019, 8:52 PM GMT+9:30 - info: [main/set-docker-env] Received Docker Machine env. export DOCKER_TLS_VERIFY="1"
export DOCKER_HOST="tcp://192.168.75.100:2376"
export DOCKER_CERT_PATH="/Users/ericdaams/.docker/machine/machines/local-by-flywheel"
export DOCKER_MACHINE_NAME="local-by-flywheel"
# Run this command to configure your shell: 
# eval $("/Applications/Local by Flywheel.app/Contents/Resources/extraResources/virtual-machine/vendor/docker/osx/docker-machine" env --shell bash local-by-flywheel)

Feb 20, 2019, 8:52 PM GMT+9:30 - info: [main/docker-machine] checking IP
Feb 20, 2019, 8:52 PM GMT+9:30 - info: [main/docker-machine] checked IP 192.168.75.100

Feb 20, 2019, 8:52 PM GMT+9:30 - info: [main/docker-machine-fdv] NFS Mount Status 
{ mountedPoints: [ '/Users', '/Volumes' ],
  mountPoints: [ '/Users', '/Volumes' ] }
Feb 20, 2019, 8:52 PM GMT+9:30 - info: [main/docker-machine-fdv] unfsd already running
Feb 20, 2019, 8:52 PM GMT+9:30 - info: [EnvironmentCustom] Empty /etc/mysql
Feb 20, 2019, 8:52 PM GMT+9:30 - info: [main/docker-router] getRouterContainers()
Feb 20, 2019, 8:52 PM GMT+9:30 - info: [main/docker-router] teardown()
Feb 20, 2019, 8:52 PM GMT+9:30 - info: [main/docker-router] Removing router container c98ed0aa427b642fb3779a6674c1ed55fd33e8cda10fcd24710539ab3d1eb2c3
Feb 20, 2019, 8:52 PM GMT+9:30 - info: [main/docker-router] updateProxyManager()
Feb 20, 2019, 8:52 PM GMT+9:30 - info: [main/docker-router] runContainer()
Feb 20, 2019, 8:52 PM GMT+9:30 - info: [main/docker-network-manager] removeExistingNetworks
Feb 20, 2019, 8:52 PM GMT+9:30 - info: [main/docker-network-manager] createNetwork
Feb 20, 2019, 8:52 PM GMT+9:30 - info: [EnvironmentCustom] Copying MySQL config to container prior to starting.
Feb 20, 2019, 8:52 PM GMT+9:30 - info: [main/docker-router] reconnectNetwork()
Feb 20, 2019, 8:52 PM GMT+9:30 - info: [main/waitForFile] Waiting for  /conf/php/7.0.3/etc/php-fpm.conf c44bc02a1dcc15a3ed7a2c58f3186a6a33190f254e5fde69cabb37c2807307f6
Feb 20, 2019, 8:52 PM GMT+9:30 - info: [main/waitForFile] /conf/php/7.0.3/etc/php-fpm.conf exists
Feb 20, 2019, 8:52 PM GMT+9:30 - info: [EnvironmentCustom]  Starting php-fpm  done
Feb 20, 2019, 8:52 PM GMT+9:30 - warn: [main/waitForMySQL] waitForMySQL Response: 
{ stdout: '', stderr: '' }
Feb 20, 2019, 8:52 PM GMT+9:30 - warn: [main/waitForMySQL] waitForMySQL Response: 
{ stdout: '', stderr: '' }
Feb 20, 2019, 8:52 PM GMT+9:30 - warn: [main/waitForMySQL] waitForMySQL Response: 
{ stdout: '', stderr: '' }
Feb 20, 2019, 8:52 PM GMT+9:30 - warn: [main/SiteModel] wpInstalled not returning "installed" 
{ message: '',
  stack:
   'Error\n    at /Applications/Local by Flywheel.app/Contents/Resources/app.asar/main/actions-sites/wait-for-mysql.js:1:2853\n    at Generator.next (<anonymous>)\n    at _0x5bab70 (/Applications/Local by Flywheel.app/Contents/Resources/app.asar/main/actions-sites/wait-for-mysql.js:1:1645)\n    at /Applications/Local by Flywheel.app/Contents/Resources/app.asar/main/actions-sites/wait-for-mysql.js:1:1904\n    at process._tickCallback (internal/process/next_tick.js:68:7)' }