# 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:** 1

<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 9, 2021, 9:12pm UTC](https://community.kinsta.com/t/error-establishing-a-database-connection/914/1 "2021-08-09T21:12:31Z")

</div>

Hello,  
i updated devKinsta and Docker now when i try to open one of the sites i get the error “Error establishing a database connection”.  
It happens with all sites, if I try to open the database here too there are errors.  
I am attaching screenshots.

 ![error Database MYSQL](https://us1.discourse-cdn.com/flex020/uploads/kinsta/original/1X/416becdc729b23e461d9b6bc2d7b16d5986d44ea.png)

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 9, 2021, 9:38pm UTC](https://community.kinsta.com/t/error-establishing-a-database-connection/914/2 "2021-08-09T21:38:54Z")

</div>

Hi @WoodyP . [It sounds like you may be experiencing the issue highlighted here](https://community.kinsta.com/t/can-t-select-database-after-docker-upgrade/773/37). Could you tell me if the solution posted there works for you?

---

<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 9, 2021, 11:34pm UTC](https://community.kinsta.com/t/error-establishing-a-database-connection/914/3 "2021-08-09T23:34:19Z")

</div>

Nothing does not work, it was already 59gb, I took it to the maximum Disk image size: 73.5 GB (5.2 GB used), but the problem remains, the database does not connect.  
I hope I haven’t lost everything…

---

<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 10, 2021, 2:42pm UTC](https://community.kinsta.com/t/error-establishing-a-database-connection/914/4 "2021-08-10T14:42:34Z")

</div>

@WoodyP Are all containers running on Docker?

 ![image](https://us1.discourse-cdn.com/flex020/uploads/kinsta/original/1X/35b61a490092692b50bd7c6458744d89cd0194c1.png)

---

<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 10, 2021, 2:44pm UTC](https://community.kinsta.com/t/error-establishing-a-database-connection/914/5 "2021-08-10T14:44:21Z")

</div>

yes all containers are running…

---

<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 10, 2021, 2:54pm UTC](https://community.kinsta.com/t/error-establishing-a-database-connection/914/6 "2021-08-10T14:54:40Z")

</div>

I see. DevKinsta may need to be re-installed. Would you be able to do that and let me know if that helps?

---

<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 10, 2021, 2:56pm UTC](https://community.kinsta.com/t/error-establishing-a-database-connection/914/7 "2021-08-10T14:56:54Z")

</div>

but do I lose all my jobs?  
I have a Mac, do I need to download and overwrite the application?

---

<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 10, 2021, 3:00pm UTC](https://community.kinsta.com/t/error-establishing-a-database-connection/914/8 "2021-08-10T15:00:02Z")

</div>

You will not lose the data as that information will stay within Docker and local folders. Before you do that, could you paste a screenshot of the following within Terminal?

```auto
docker exec -it devkinsta_db bash
mysql -p
#here copy your db password
show databases;

```

> [@WoodyP](#):
>
> I have a Mac, do I need to download and overwrite the application?

Yeap!

---

<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 10, 2021, 3:06pm UTC](https://community.kinsta.com/t/error-establishing-a-database-connection/914/9 "2021-08-10T15:06:09Z")

</div>

do i have to send your code to the computer terminal?

---

<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 10, 2021, 3:09pm UTC](https://community.kinsta.com/t/error-establishing-a-database-connection/914/10 "2021-08-10T15:09:33Z")

</div>

That’s correct. Try each line one by one.

---

<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 10, 2021, 3:19pm UTC](https://community.kinsta.com/t/error-establishing-a-database-connection/914/11 "2021-08-10T15:19:11Z")

</div>

Here is the screenshot of the terminal.  
thank you

> **Summary**
>
> ![terminal](https://us1.discourse-cdn.com/flex020/uploads/kinsta/original/1X/60a5e5f51f0019e3a4d42c6ce1259ac32ef0ae60.png)

---

<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 10, 2021, 3:44pm UTC](https://community.kinsta.com/t/error-establishing-a-database-connection/914/12 "2021-08-10T15:44:50Z")

</div>

I reinstalled the devkinsta application, the problem is not solved.

---

<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 10, 2021, 9:40pm UTC](https://community.kinsta.com/t/error-establishing-a-database-connection/914/13 "2021-08-10T21:40:07Z")

</div>

> [@WoodyP](#):
>
> Here is the screenshot of the terminal.  
> thank you

It looks like the database password that was entered here did not work. [Here’s a guide on where to find the password for the database](https://kinsta.com/knowledgebase/devkinsta/database-manager/#enter-through-host-machine). Let me know if that works for you.

---

<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 11, 2021, 10:49am UTC](https://community.kinsta.com/t/error-establishing-a-database-connection/914/14 "2021-08-11T10:49:29Z")

</div>

Hello,  
it does not actually allow me to enter the password, every time it asks me to enter it, the cursor does not write.  
I tried to access by re-entering the line “mysql -p” but the password does not make it enter …

---

<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 11, 2021, 3:01pm UTC](https://community.kinsta.com/t/error-establishing-a-database-connection/914/15 "2021-08-11T15:01:00Z")

</div>

Within Docker, could you try deleting **devkinsta\_db** and the **devkinsta\_db\_data** volume as well? Re-open DevKinsta and it should download those again. We believe something may have gone wrong during the update on your machine.

---

<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 11, 2021, 4:11pm UTC](https://community.kinsta.com/t/error-establishing-a-database-connection/914/16 "2021-08-11T16:11:21Z")

</div>

Hello,  
will I not lose my works by deleting the DB container?

Among other things, Docker is missing one of the containers that you reported the “devkinsta\_db\_data”

 ![docker](https://us1.discourse-cdn.com/flex020/uploads/kinsta/original/1X/9bd2a60acf491d47e591af3d3aabfce1ed093451.png)

---

<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 12, 2021, 3:25pm UTC](https://community.kinsta.com/t/error-establishing-a-database-connection/914/17 "2021-08-12T15:25:47Z")

</div>

Hello,  
sorry yes i found **devkinsta\_db\_data** is a volume not a container like **devkinsta\_db**.  
So do I have to delete them? won’t i lose my jobs?

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 12, 2021, 3:31pm UTC](https://community.kinsta.com/t/error-establishing-a-database-connection/914/18 "2021-08-12T15:31:35Z")

</div>

To backup the database, you’ll need to be able to login with `mysql -p` but I understand it’s giving you issues. Keep in mind that when entering the password, it’s hidden by default. Perhaps it’s entering but as it’s hidden, it’s not showing? Try pasting the password anyway and see if it lets you in.

---

<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 12, 2021, 10:04pm UTC](https://community.kinsta.com/t/error-establishing-a-database-connection/914/19 "2021-08-12T22:04:05Z")

</div>

Hello,  
you were right, pasting you do not see anything, but confirming, it goes on. Tell me what to do now before I delete the containers.

 ![terminal](https://us1.discourse-cdn.com/flex020/uploads/kinsta/original/1X/cbb1ae6db17d165536b669b57cae75e74b40c4e6.jpeg)

---

<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 13, 2021, 2:11pm UTC](https://community.kinsta.com/t/error-establishing-a-database-connection/914/20 "2021-08-13T14:11:54Z")

</div>

Unfortunately based on that screenshot, it appears the database is missing. That would explain why it’s been appearing as “Error establishing a database connection”. Do you recall how DevKinsta and Docker was updated? Did you by chance uninstall it?

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