# Error establishing a database connection

**URL:** https://community.kinsta.com/t/error-establishing-a-database-connection/914
**Category:** Application Support
**Created:** [August 9, 2021, 9:12pm UTC](https://community.kinsta.com/t/error-establishing-a-database-connection/914 "2021-08-09T21:12:31Z")
**Posts on this page:** 20
**Page:** 2

<div class="post-metadata">

### Author: ![WoodyP](https://avatars.discourse-cdn.com/v4/letter/w/67e7ee/32.png) [@WoodyP](https://community.kinsta.com/u/WoodyP)
#### Post date: [August 13, 2021, 4:19pm UTC](https://community.kinsta.com/t/error-establishing-a-database-connection/914/21 "2021-08-13T16:19:04Z")

</div>

Hello,  
I have not uninstalled anything …  
The updates took place automatically.

How did I lose my 5 projects ???

---

<div class="post-metadata">

### Author: ![WoodyP](https://avatars.discourse-cdn.com/v4/letter/w/67e7ee/32.png) [@WoodyP](https://community.kinsta.com/u/WoodyP)
#### Post date: [August 15, 2021, 2:42pm UTC](https://community.kinsta.com/t/error-establishing-a-database-connection/914/22 "2021-08-15T14:42:11Z")

</div>

Hello,  
for too many days I have stopped with my work, because of this …  
I have a time machine backup updated to last month, I decided to restore it since it seems that your updates have deleted my works. Clearly I lost 15/20 days of work …

Tell me which folders I need to restore from time machine to get my jobs.

Thank you  
I’m waiting.

---

<div class="post-metadata">

### Author: ![michael](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/michael/32/31_2.png) [@michael](https://community.kinsta.com/u/michael)
#### Post date: [August 16, 2021, 2:35pm UTC](https://community.kinsta.com/t/error-establishing-a-database-connection/914/23 "2021-08-16T14:35:24Z")

</div>

Hi @WoodyP . Updates don’t cause deletion of the volumes so we’re not exactly sure what could have caused this here. We’re not aware of this happening for anyone else in the past. The development team will continue to investigate however and have logged an internal investigation of this issue.

As for what to restore, you’ll want to restore the `devkinsta_db` container. The default location for Docker is `~/Library/Containers/com.docker.docker/`. [I found this that might help](https://dev.to/moyarich/how-to-find-the-storage-location-of-docker-images-and-containers-on-a-mac-369i).

---

<div class="post-metadata">

### Author: ![WoodyP](https://avatars.discourse-cdn.com/v4/letter/w/67e7ee/32.png) [@WoodyP](https://community.kinsta.com/u/WoodyP)
#### Post date: [August 17, 2021, 7:00am UTC](https://community.kinsta.com/t/error-establishing-a-database-connection/914/24 "2021-08-17T07:00:23Z")

</div>

Hello,  
I am attaching a video screen, here you will see that the volumes still exist.

In the path you indicated there are no devkinsta\_db folders. This seems to be correct, in fact even in the link you attached there is a screenshot and that volume is not there.

> **Summary**
>
> [Dropbox - DOCKER.mp4 - Simplify your life](https://www.dropbox.com/s/i5u4arb9419scks/DOCKER.mp4?dl=0)
> 
> I leave you some info of my computer:  
> MacBook 2018  
> recently updated operating system Big Sur

I hope this can help to provide some help to recover my work.  
Thank you

---

<div class="post-metadata">

### Author: ![michael](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/michael/32/31_2.png) [@michael](https://community.kinsta.com/u/michael)
#### Post date: [August 18, 2021, 1:53pm UTC](https://community.kinsta.com/t/error-establishing-a-database-connection/914/25 "2021-08-18T13:53:13Z")

</div>

Hi @WoodyP  
Within the **devkinsta\_db** container, we mount the Docker volume: **devkinsta\_db\_data**

To container path: /var/lib/mysql/

I see in the video that you’ve navigated into ~/Library/Containers/com.docker.docker/data/vms/. Continue down that path. [Option 1 from this guide may help here](https://dev.to/moyarich/how-to-find-the-storage-location-of-docker-images-and-containers-on-a-mac-369i).

---

<div class="post-metadata">

### Author: ![WoodyP](https://avatars.discourse-cdn.com/v4/letter/w/67e7ee/32.png) [@WoodyP](https://community.kinsta.com/u/WoodyP)
#### Post date: [August 18, 2021, 2:12pm UTC](https://community.kinsta.com/t/error-establishing-a-database-connection/914/26 "2021-08-18T14:12:38Z")

</div>

Hello,  
sorry still not clear, and I’m stuck with work …  
I regretted using devKinsta a little.

/ var / lib / mysql /  
The path does not seem to be anything

> **Summary**
>
> [Dropbox - 2.png - Simplify your life](https://www.dropbox.com/s/51pj282xhubwu55/2.png?dl=0)

~ / Library / Containers / com.docker.docker / data / vms /  
At this I see the folders, what should I do?

> **Summary**
>
> [Dropbox - 1.png - Simplify your life](https://www.dropbox.com/s/av40hb6prdoawox/1.png?dl=0)

---

<div class="post-metadata">

### Author: ![michael](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/michael/32/31_2.png) [@michael](https://community.kinsta.com/u/michael)
#### Post date: [August 18, 2021, 2:54pm UTC](https://community.kinsta.com/t/error-establishing-a-database-connection/914/27 "2021-08-18T14:54:03Z")

</div>

Looking at the images you have there, try restoring `~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw` and restart Docker from there.

Once you’ve done that, run the following on Terminal: `docker run -it --rm -v devkinsta_db_data:/tmp/db alpine ls /tmp/db`

Let me know what you see after running that command.

---

<div class="post-metadata">

### Author: ![WoodyP](https://avatars.discourse-cdn.com/v4/letter/w/67e7ee/32.png) [@WoodyP](https://community.kinsta.com/u/WoodyP)
#### Post date: [August 18, 2021, 11:12pm UTC](https://community.kinsta.com/t/error-establishing-a-database-connection/914/28 "2021-08-18T23:12:40Z")

</div>

Hello,  
time machine doesn’t make me restore that folder to last month, while it makes me roll back the application to last month.

Anyway I ran the line from the terminal anyway, this is what it showed. see screen shot

> **Summary**
>
> [Dropbox - terminal-2.png - Simplify your life](https://www.dropbox.com/s/l7x71361w9ychpl/terminal-2.png?dl=0)

---

<div class="post-metadata">

### Author: ![WoodyP](https://avatars.discourse-cdn.com/v4/letter/w/67e7ee/32.png) [@WoodyP](https://community.kinsta.com/u/WoodyP)
#### Post date: [August 19, 2021, 8:48am UTC](https://community.kinsta.com/t/error-establishing-a-database-connection/914/29 "2021-08-19T08:48:01Z")

</div>

Hello,  
in time machine in my backups, I don’t see any Docker folders.  
I activated the display of hidden folders with the key combination “cmd + shift +.” so I see the user library, I navigated the path you indicated, but among all the backups even the last one made today, I don’t see that folder.

While in my computer I see the folder.

---

<div class="post-metadata">

### Author: ![michael](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/michael/32/31_2.png) [@michael](https://community.kinsta.com/u/michael)
#### Post date: [August 19, 2021, 2:21pm UTC](https://community.kinsta.com/t/error-establishing-a-database-connection/914/30 "2021-08-19T14:21:08Z")

</div>

It sounds like Time Machine may not have backed up that directory 😞 . Are you able to check if that directory is excluded on your backups?

---

<div class="post-metadata">

### Author: ![WoodyP](https://avatars.discourse-cdn.com/v4/letter/w/67e7ee/32.png) [@WoodyP](https://community.kinsta.com/u/WoodyP)
#### Post date: [August 19, 2021, 2:57pm UTC](https://community.kinsta.com/t/error-establishing-a-database-connection/914/31 "2021-08-19T14:57:11Z")

</div>

I have not excluded anything from the backup, time machine is set to automatically backup the whole computer.  
In fact, in the user library I find all the other software.

But how is it possible that the updates have deleted the databases of my works in devKinsta?  
I see the folders of the sites with all the files, in devKinsta there are the sites with their previews and settings.  
How is it possible that they have deleted the databases by themselves?

To check the weight of the “Docker.raw” file I installed devkinsta on my iMac where I use Mamp.  
I noticed that the empty “Docker.raw” file weighs about 64gb, while the file in which I have the sites weighs 79gb.

Is it possible that the db data has not been deleted?

---

<div class="post-metadata">

### Author: ![michael](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/michael/32/31_2.png) [@michael](https://community.kinsta.com/u/michael)
#### Post date: [August 19, 2021, 9:58pm UTC](https://community.kinsta.com/t/error-establishing-a-database-connection/914/32 "2021-08-19T21:58:23Z")

</div>

> [@WoodyP](#):
>
> But how is it possible that the updates have deleted the databases of my works in devKinsta?

We’re not sure exactly here as it has never occurred before. The contents container are binded thus is extremely unlikely that the updates would have deleted it.

> [@WoodyP](#):
>
> Is it possible that the db data has not been deleted?

It’s possible, but they are not shown in the container from one of the screenshots you provided earlier.

---

<div class="post-metadata">

### Author: ![WoodyP](https://avatars.discourse-cdn.com/v4/letter/w/67e7ee/32.png) [@WoodyP](https://community.kinsta.com/u/WoodyP)
#### Post date: [August 20, 2021, 8:27am UTC](https://community.kinsta.com/t/error-establishing-a-database-connection/914/33 "2021-08-20T08:27:18Z")

</div>

Everything seems to be there where it belongs, folders with site files, containers on docker etc.  
So what should I do?  
Do I have to think that my works have been lost?

I have to start my work all over again… I feel like crying ☹  
Unfortunately I will no longer be able to trust devKinsta…

I still hope for a solution, but I am really behind with my work, especially if I have to start all over again…

---

<div class="post-metadata">

### Author: ![michael](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/michael/32/31_2.png) [@michael](https://community.kinsta.com/u/michael)
#### Post date: [August 20, 2021, 2:45pm UTC](https://community.kinsta.com/t/error-establishing-a-database-connection/914/34 "2021-08-20T14:45:44Z")

</div>

@WoodyP I’ve asked the engineering team again to review this thread. We’re not sure why they don’t appear to exist on your time machine. The only thing I can think of is that time machine is excluding large files which is often the case for virtual machines. I’m so sorry for the issues here 😞

---

<div class="post-metadata">

### Author: ![WoodyP](https://avatars.discourse-cdn.com/v4/letter/w/67e7ee/32.png) [@WoodyP](https://community.kinsta.com/u/WoodyP)
#### Post date: [August 20, 2021, 2:56pm UTC](https://community.kinsta.com/t/error-establishing-a-database-connection/914/35 "2021-08-20T14:56:28Z")

</div>

nenache I do not understand why there is no file in the time machine.  
It actually copies everything even, mamp, dropbox, drive etc …

In any case on my computer I see all the site folders in devKinsta and in Docker I see the containers, the file seems to be there where you indicated.  
So what is it that happens? because there is everything, but it seems there are no databases? which are really missing?  
The container file weighs about 20gb more than the original file.

---

<div class="post-metadata">

### Author: ![michael](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/michael/32/31_2.png) [@michael](https://community.kinsta.com/u/michael)
#### Post date: [August 20, 2021, 9:42pm UTC](https://community.kinsta.com/t/error-establishing-a-database-connection/914/36 "2021-08-20T21:42:15Z")

</div>

> [@WoodyP](#):
>
> So what is it that happens? because there is everything, but it seems there are no databases? which are really missing?

You’d be able to find everything inside the virtual environment which is why recovering the raw file of the environment would have helped restore it. 😞

---

<div class="post-metadata">

### Author: ![WoodyP](https://avatars.discourse-cdn.com/v4/letter/w/67e7ee/32.png) [@WoodyP](https://community.kinsta.com/u/WoodyP)
#### Post date: [August 21, 2021, 9:39am UTC](https://community.kinsta.com/t/error-establishing-a-database-connection/914/37 "2021-08-21T09:39:27Z")

</div>

Yes this is clear to me. But it is not clear why this file was not copied within the hidden library.

In any case, I was wondering if everything on my computer could still be recovered.  
As I said before on my computer the site folders are there, the containers in Docker are there, the sites in devKinsta are there, the .raw file is still there and weighs 79gb, so something is there.

I wonder if it’s still recoverable before it deletes everything permanently.

---

<div class="post-metadata">

### Author: ![WoodyP](https://avatars.discourse-cdn.com/v4/letter/w/67e7ee/32.png) [@WoodyP](https://community.kinsta.com/u/WoodyP)
#### Post date: [August 23, 2021, 6:54am UTC](https://community.kinsta.com/t/error-establishing-a-database-connection/914/38 "2021-08-23T06:54:23Z")

</div>

Hello,  
often this message “Error establishing a database connection” is also due to the fact that the db user is not found.

So I was thinking, is it possible that devKinsta no longer finds the db user? Usually I is entered manually by phpamydmin, in deKinsta it happens automatically, but is it possible that it refers to the name of the computer?  
During the update I changed its computer name.

Could explain the non-link to the db

---

<div class="post-metadata">

### Author: ![michael](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/michael/32/31_2.png) [@michael](https://community.kinsta.com/u/michael)
#### Post date: [August 23, 2021, 2:39pm UTC](https://community.kinsta.com/t/error-establishing-a-database-connection/914/39 "2021-08-23T14:39:41Z")

</div>

> [@WoodyP](#):
>
> often this message “Error establishing a database connection” is also due to the fact that the db user is not found.

That’s true, but the user is always root here and earlier when running `show databases;` it showed no databases.

> [@WoodyP](#):
>
> the .raw file is still there and weighs 79gb

Yeah, often virtual environments are large.

---

<div class="post-metadata">

### Author: ![WoodyP](https://avatars.discourse-cdn.com/v4/letter/w/67e7ee/32.png) [@WoodyP](https://community.kinsta.com/u/WoodyP)
#### Post date: [August 23, 2021, 2:58pm UTC](https://community.kinsta.com/t/error-establishing-a-database-connection/914/40 "2021-08-23T14:58:22Z")

</div>

Ok, there is nothing to do …  
I don’t understand how an update could have wiped out just the databases.

Clearly I will not use devKinsta I do not feel safe anymore, I have lost 5 projects … ☹

[Previous page](https://community.kinsta.com/t/error-establishing-a-database-connection/914.md?page=1)

[Next page](https://community.kinsta.com/t/error-establishing-a-database-connection/914.md?page=3)
