# Database connection

**URL:** <https://community.localwp.com/t/database-connection/43914>\
**Category:** Support\
**Tags:** database\
**Created:** [July 28, 2024, 10:50am UTC](https://community.localwp.com/t/database-connection/43914 "2024-07-28T10:50:50Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dirk](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/dirk/32/22326_2.png) [@Dirk](https://community.localwp.com/u/Dirk)\
**Post date:** [July 28, 2024, 10:50am UTC](https://community.localwp.com/t/database-connection/43914/1 "2024-07-28T10:50:50Z")

</div>

### What issue or error are you experiencing?

I can’t connect to the database.

* * *

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

I start a wp instance vi Localwp UI and then I try to connect with the database. For that I use the link in the database tab. On the webbrowser I got in error message that the connection cannot create. The link to the database is [http://localhost:10065/?username=xxxx&db=local](http://localhost:10065/?username=xxxx&db=local) I check with `sudo netstat -ntlp | grep LISTEN` that the localwp database is running on this port. Do you have any hints?

* * *

### System Details

- **Local Version:**  
9.0.5
- **Operating System (OS) and OS version:**  
Ubuntu 20.04.6

* * *

### Local Logs

Attach your Local Logs here ([Help Doc - Retrieving Local’s Log](https://localwp.com/help-docs/troubleshooting/retrieving-locals-log-file/))

* * *

_ **Security Reminder** _  
Local does a pretty good job of scrubbing private info from the logs and the errors it produces, however there’s always the possibility that something private can come through. Because these are public forums, always review the screenshots you are sharing to make sure there isn’t private info like passwords being displayed.

---

<div class="post-metadata">

**Author:** ![ben.turner](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/ben.turner/32/5366_2.png) [@ben.turner](https://community.localwp.com/u/ben.turner)\
**Post date:** [July 29, 2024, 5:39pm UTC](https://community.localwp.com/t/database-connection/43914/2 "2024-07-29T17:39:52Z")

</div>

Since you’re on Linux and trying to connect to the DB over TCP/IP, I think you’ll need to follow the steps in this FAQ:

> [@How can I connect to MySQL using TCP/IP rather than a socket on macOS/Linux?](https://community.localwp.com/t/how-can-i-connect-to-mysql-using-tcp-ip-rather-than-a-socket-on-macos-linux/21220):
>
> Depending on the application you’re using to connect to MySQL, you may be required to connect using TCP/IP rather than Unix sockets. To connect via TCP/IP, you will need to create a new user on the IPv4 loopback IP (127.0.0.1) IP and grant it privileges. Steps Right-click on the site you wish to connect to via TCP/IP in Local’s sidebar and go to “Open Site Shell.” Once your terminal opens, run the following commands: Allow root to connect via 127.0.0.1. mysql -e "CREATE USER 'root'@'…

---

<div class="post-metadata">

**Author:** ![Dirk](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/dirk/32/22326_2.png) [@Dirk](https://community.localwp.com/u/Dirk)\
**Post date:** [October 16, 2024, 6:23pm UTC](https://community.localwp.com/t/database-connection/43914/3 "2024-10-16T18:23:48Z")

</div>

I saw this [Adminer Evo: localhost refused to connect Linux Mint](https://community.localwp.com/t/adminer-evo-localhost-refused-to-connect-linux-mint/44442) ticket and I upgraded to 9.0.3. Afterwards it works fine again.

---

<div class="post-metadata">

**Author:** ![Nick-B](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/nick-b/32/16140_2.png) [@Nick-B](https://community.localwp.com/u/Nick-B)\
**Post date:** [October 21, 2024, 1:52pm UTC](https://community.localwp.com/t/database-connection/43914/6 "2024-10-21T13:52:59Z")

</div>

Hey @Dirk

I’ve shared this with the Local devs, and they’ve filed a bug for it. We don’t have an ETA on when this will be addressed, so for now, you’ll want to remain on that 9.0.3 version if that is working for you.

---

<div class="post-metadata">

**Author:** ![Dirk](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/dirk/32/22326_2.png) [@Dirk](https://community.localwp.com/u/Dirk)\
**Post date:** [October 21, 2024, 2:22pm UTC](https://community.localwp.com/t/database-connection/43914/7 "2024-10-21T14:22:19Z")

</div>

Hello Nick-B, yes it works for me. Thanks for your feedback.

---

<div class="post-metadata">

**Author:** ![Nick-B](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/nick-b/32/16140_2.png) [@Nick-B](https://community.localwp.com/u/Nick-B)\
**Post date:** [October 21, 2024, 2:31pm UTC](https://community.localwp.com/t/database-connection/43914/8 "2024-10-21T14:31:04Z")

</div>

Glad to hear it! When we do get a fix in place we’ll be sure to share an update here in the forums. We also post notes with each release of what’s included on our releases page here:

> **[Releases](https://localwp.com/releases/)**

---

<div class="post-metadata">

**Author:** ![system](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/system/32/1_2.png) [@system](https://community.localwp.com/u/system)\
**Post date:** [October 23, 2024, 2:31am UTC](https://community.localwp.com/t/database-connection/43914/9 "2024-10-23T02:31:30Z")

</div>

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