# Error establishing a database connection - Issue with MySQL / phpMyAdmin

**URL:** <https://forum.hestiacp.com/t/error-establishing-a-database-connection-issue-with-mysql-phpmyadmin/13594>\
**Category:** Database\
**Created:** [March 27, 2024, 9:56pm UTC](https://forum.hestiacp.com/t/error-establishing-a-database-connection-issue-with-mysql-phpmyadmin/13594 "2024-03-27T21:56:53Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![noni](https://forum.hestiacp.com/letter_avatar_proxy/v4/letter/n/ba9def/32.png) [@noni](https://forum.hestiacp.com/u/noni)\
**Post date:** [March 27, 2024, 9:56pm UTC](https://forum.hestiacp.com/t/error-establishing-a-database-connection-issue-with-mysql-phpmyadmin/13594/1 "2024-03-27T21:56:53Z")

</div>

Hello friends, I moved from Plesk to HestiaCP and am a bit lost.  
I did a clean install of HestiaCP on a fresh Debian 12 machine.

- Run install script
- Modify a few settings (e.g. disable plugins and php versions I don’t need)
- Create a new user
- Add a couple domains
- Enable SSL for all domains

Everything seems to run smoothly except there seems to be something wrong with mysql: Database creation via Hestia works. But when I try to do a wordpress install, I get “Error establishing a database connection” (whether I let the Quick Install create the database or use an exisiting one doesn’t matter)  
As you can see in my screenshots, the databases create just fine, but when I attempt to use phpMyAdmin to access them, I am greeted with a bunch of errors and warnings.

 ![image](https://forum.hestiacp.com/uploads/default/original/2X/e/e64ea83b7a9bc198d2b1131ecff7a2c9629e6c6a.png)

What I’ve tried:

- Do the complete installation process again on a different machine.
- Change root password using mysqladmin and in /root/.my.cnf & /usr/local/hestia/conf/mysql.conf to a different one

---

<div class="post-metadata">

**Author:** ![noni](https://forum.hestiacp.com/letter_avatar_proxy/v4/letter/n/ba9def/32.png) [@noni](https://forum.hestiacp.com/u/noni)\
**Post date:** [March 27, 2024, 9:57pm UTC](https://forum.hestiacp.com/t/error-establishing-a-database-connection-issue-with-mysql-phpmyadmin/13594/2 "2024-03-27T21:57:42Z")

</div>

Unable to post multiple images in one message, but I think these are important:  
 ![image](https://forum.hestiacp.com/uploads/default/original/2X/e/e445fbf82194b072f008ab0667e4df0b2ac8cf47.png)

---

<div class="post-metadata">

**Author:** ![noni](https://forum.hestiacp.com/letter_avatar_proxy/v4/letter/n/ba9def/32.png) [@noni](https://forum.hestiacp.com/u/noni)\
**Post date:** [March 27, 2024, 9:58pm UTC](https://forum.hestiacp.com/t/error-establishing-a-database-connection-issue-with-mysql-phpmyadmin/13594/3 "2024-03-27T21:58:19Z")

</div>

![image](https://forum.hestiacp.com/uploads/default/original/2X/d/d62adaa22fbd4e3f1cdb9d19c0b976fba9e38172.png)

---

<div class="post-metadata">

**Author:** ![sahsanu](https://forum.hestiacp.com/user_avatar/forum.hestiacp.com/sahsanu/32/10259_2.png) [@sahsanu](https://forum.hestiacp.com/u/sahsanu)\
**Post date:** [March 27, 2024, 11:02pm UTC](https://forum.hestiacp.com/t/error-establishing-a-database-connection-issue-with-mysql-phpmyadmin/13594/4 "2024-03-27T23:02:14Z")

</div>

> [@noni](#):
>
> I think these are important:

You don’t have the phpmyadmin db created so, something failed during install.

---

<div class="post-metadata">

**Author:** ![noni](https://forum.hestiacp.com/letter_avatar_proxy/v4/letter/n/ba9def/32.png) [@noni](https://forum.hestiacp.com/u/noni)\
**Post date:** [March 27, 2024, 11:17pm UTC](https://forum.hestiacp.com/t/error-establishing-a-database-connection-issue-with-mysql-phpmyadmin/13594/5 "2024-03-27T23:17:15Z")

</div>

Hi sahsanu, thanks for the reply. You are correct, I found the following in the output of my setup script:

 ![image](https://forum.hestiacp.com/uploads/default/original/2X/e/ed3e06c97146b1a6d6bf1981973db3ee83b2086a.png)

I also saw a bunch of warnings but I suppose those don’t matter:

```auto
[!] Adding missing variable to hestia.conf: ENFORCE_SUBDOMAIN_OWNERSHIP ('yes')
[!] Adding missing variable to hestia.conf: DEBUG_MODE ('false')

```

Apart from that, no anomalies in the logs.

What could be the reason for the mariadb access denied error?  
How do I approach fixing this? I’m on a fresh Debian 12 minimal install.

---

<div class="post-metadata">

**Author:** ![sahsanu](https://forum.hestiacp.com/user_avatar/forum.hestiacp.com/sahsanu/32/10259_2.png) [@sahsanu](https://forum.hestiacp.com/u/sahsanu)\
**Post date:** [March 27, 2024, 11:20pm UTC](https://forum.hestiacp.com/t/error-establishing-a-database-connection-issue-with-mysql-phpmyadmin/13594/6 "2024-03-27T23:20:24Z")

</div>

> [@noni](#):
>
> ```auto
> [!] Adding missing variable to hestia.conf: ENFORCE_SUBDOMAIN_OWNERSHIP ('yes')
> [!] Adding missing variable to hestia.conf: DEBUG_MODE ('false')
> 
> ```

Those messages are ok.

Could you please show the output of this command?

```auto
grep localhost /etc/hosts

```

Regarding phpmyadmin, let’s see this first and I will tell you a way to try to reinstall it.

---

<div class="post-metadata">

**Author:** ![noni](https://forum.hestiacp.com/letter_avatar_proxy/v4/letter/n/ba9def/32.png) [@noni](https://forum.hestiacp.com/u/noni)\
**Post date:** [March 27, 2024, 11:24pm UTC](https://forum.hestiacp.com/t/error-establishing-a-database-connection-issue-with-mysql-phpmyadmin/13594/7 "2024-03-27T23:24:31Z")

</div>

Here you go:

```auto
root@centaur:~# grep localhost /etc/hosts
127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback

```

---

<div class="post-metadata">

**Author:** ![sahsanu](https://forum.hestiacp.com/user_avatar/forum.hestiacp.com/sahsanu/32/10259_2.png) [@sahsanu](https://forum.hestiacp.com/u/sahsanu)\
**Post date:** [March 27, 2024, 11:31pm UTC](https://forum.hestiacp.com/t/error-establishing-a-database-connection-issue-with-mysql-phpmyadmin/13594/8 "2024-03-27T23:31:48Z")

</div>

That looks fine.

Try this command and show me the output:

```auto
mysql -u root -h localhost -e 'show databases;'

```

If it shows an error like:

```auto
ERROR 1698 (28000): Access denied for user 'root'@'localhost'

```

Edit file `/etc/hosts` and remove `localhost` from this line:

```auto
::1 localhost ip6-localhost ip6-loopback

```

So it will look like this:

```auto
::1 ip6-localhost ip6-loopback

```

And try the mysql command again.

---

<div class="post-metadata">

**Author:** ![bahcecim](https://forum.hestiacp.com/user_avatar/forum.hestiacp.com/bahcecim/32/9422_2.png) [@bahcecim](https://forum.hestiacp.com/u/bahcecim)\
**Post date:** [March 12, 2026, 10:43am UTC](https://forum.hestiacp.com/t/error-establishing-a-database-connection-issue-with-mysql-phpmyadmin/13594/9 "2026-03-12T10:43:39Z")

</div>

I have same problem, I followed @sahsanu but no result.
