# Unable to login to mysql after the fireware update - mysqli::real\_connect(): (HY000/2002): Connection refused

**URL:** <https://community.wd.com/t/unable-to-login-to-mysql-after-the-fireware-update-mysqli-real-connect-hy000-2002-connection-refused/286515>\
**Category:** My Cloud Mirror\
**Created:** [October 31, 2023, 10:37pm UTC](https://community.wd.com/t/unable-to-login-to-mysql-after-the-fireware-update-mysqli-real-connect-hy000-2002-connection-refused/286515 "2023-10-31T22:37:42Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![lalajee](https://avatars.discourse-cdn.com/v4/letter/l/a9a28c/32.png) [@lalajee](https://community.wd.com/u/lalajee)\
**Post date:** [October 31, 2023, 10:37pm UTC](https://community.wd.com/t/unable-to-login-to-mysql-after-the-fireware-update-mysqli-real-connect-hy000-2002-connection-refused/286515/1 "2023-10-31T22:37:42Z")

</div>

When I open phpmyadmin to login to root account I get this error  
 mysqli::real\_connect(): (HY000/2002): Connection refused

I try to reset root password using this script

python3 /usr/bin/mysql\_reset.py -r

But I get this error

root@WDMyCloudMirror ~ # python3 /usr/bin/mysql\_reset.py -r  
killall: mysqld: no process killed  
killall: mysqld\_safe: no process killed  
killall: mariadbd: no process killed  
killall: mariadbd-safe: no process killed  
231031 22:37:03 mysqld\_safe Logging to ‘/mnt/HD\_a4/.@database@/WDMyCloudMirror.err’.  
231031 22:37:04 mysqld\_safe Starting mariadbd daemon with databases from /mnt/HD\_a4/.@database@  
Traceback (most recent call last):  
File “/usr/bin/mysql\_reset.py”, line 748, in   
reset\_root\_account()  
File “/usr/bin/mysql\_reset.py”, line 585, in reset\_root\_account  
if not \_get\_datadir\_from\_process\_list():  
File “/usr/bin/mysql\_reset.py”, line 72, in \_get\_datadir\_from\_process\_list  
datadir = output.decode().strip().split(“/usr/libexec/mariadbd”)[1].split(“–datadir=”)[1].split(" ")[0]  
IndexError: list index out of range  
root@WDMyCloudMirror ~ #

---

<div class="post-metadata">

**Author:** ![lalajee](https://avatars.discourse-cdn.com/v4/letter/l/a9a28c/32.png) [@lalajee](https://community.wd.com/u/lalajee)\
**Post date:** [November 1, 2023, 10:23pm UTC](https://community.wd.com/t/unable-to-login-to-mysql-after-the-fireware-update-mysqli-real-connect-hy000-2002-connection-refused/286515/3 "2023-11-01T22:23:18Z")

</div>

it is

 ![image](https://global.discourse-cdn.com/wd/original/3X/b/3/b3b9b7e29b5c5b21b89a9a7928e23e110d6a0fa7.png)

---

<div class="post-metadata">

**Author:** ![lalajee](https://avatars.discourse-cdn.com/v4/letter/l/a9a28c/32.png) [@lalajee](https://community.wd.com/u/lalajee)\
**Post date:** [November 1, 2023, 10:24pm UTC](https://community.wd.com/t/unable-to-login-to-mysql-after-the-fireware-update-mysqli-real-connect-hy000-2002-connection-refused/286515/4 "2023-11-01T22:24:47Z")

</div>

i get this erro

 ![image](https://global.discourse-cdn.com/wd/original/3X/3/8/38c50df685626d2987392181a1eaabfb623ffa70.png)

---

<div class="post-metadata">

**Author:** ![lalajee](https://avatars.discourse-cdn.com/v4/letter/l/a9a28c/32.png) [@lalajee](https://community.wd.com/u/lalajee)\
**Post date:** [November 2, 2023, 7:08pm UTC](https://community.wd.com/t/unable-to-login-to-mysql-after-the-fireware-update-mysqli-real-connect-hy000-2002-connection-refused/286515/6 "2023-11-02T19:08:43Z")

</div>

> [@Cerberus](#):
>
> python3 /usr/bin/mysql\_reset.py --reboot

Following command didnt show anything

- `pidof mariadbd;`

I already run this but i did try again

- `python3 /usr/bin/mysql_reset.py --reboot`

 ![image](https://global.discourse-cdn.com/wd/original/3X/1/7/175193dcec5e1f172d1f39d8cad493a4d40894e1.png)

---

<div class="post-metadata">

**Author:** ![lalajee](https://avatars.discourse-cdn.com/v4/letter/l/a9a28c/32.png) [@lalajee](https://community.wd.com/u/lalajee)\
**Post date:** [November 2, 2023, 8:05pm UTC](https://community.wd.com/t/unable-to-login-to-mysql-after-the-fireware-update-mysqli-real-connect-hy000-2002-connection-refused/286515/8 "2023-11-02T20:05:51Z")

</div>

It didn’t work still same issue

pidof mariadbd still show nothing

---

<div class="post-metadata">

**Author:** ![lalajee](https://avatars.discourse-cdn.com/v4/letter/l/a9a28c/32.png) [@lalajee](https://community.wd.com/u/lalajee)\
**Post date:** [November 2, 2023, 8:48pm UTC](https://community.wd.com/t/unable-to-login-to-mysql-after-the-fireware-update-mysqli-real-connect-hy000-2002-connection-refused/286515/10 "2023-11-02T20:48:22Z")

</div>

I have lot of files on this NAS, Will this remove all files

---

<div class="post-metadata">

**Author:** ![lalajee](https://avatars.discourse-cdn.com/v4/letter/l/a9a28c/32.png) [@lalajee](https://community.wd.com/u/lalajee)\
**Post date:** [November 2, 2023, 8:59pm UTC](https://community.wd.com/t/unable-to-login-to-mysql-after-the-fireware-update-mysqli-real-connect-hy000-2002-connection-refused/286515/12 "2023-11-02T20:59:02Z")

</div>

Update firmware but still same issue

 ![image](https://global.discourse-cdn.com/wd/original/3X/5/4/54da0f2637df4604fc40956a09eb94b3ca16d597.png)

It looks like sql starts and then crash it

 ![image](https://global.discourse-cdn.com/wd/original/3X/7/6/76e959d07cd4cac98fda6979f9f7cbc83b26b886.png)

---

<div class="post-metadata">

**Author:** ![lalajee](https://avatars.discourse-cdn.com/v4/letter/l/a9a28c/32.png) [@lalajee](https://community.wd.com/u/lalajee)\
**Post date:** [November 2, 2023, 10:28pm UTC](https://community.wd.com/t/unable-to-login-to-mysql-after-the-fireware-update-mysqli-real-connect-hy000-2002-connection-refused/286515/15 "2023-11-02T22:28:56Z")

</div>

You can see from above screen. It runs and find no sql is running

---

<div class="post-metadata">

**Author:** ![lalajee](https://avatars.discourse-cdn.com/v4/letter/l/a9a28c/32.png) [@lalajee](https://community.wd.com/u/lalajee)\
**Post date:** [November 2, 2023, 10:44pm UTC](https://community.wd.com/t/unable-to-login-to-mysql-after-the-fireware-update-mysqli-real-connect-hy000-2002-connection-refused/286515/16 "2023-11-02T22:44:11Z")

</div>

> [@Cerberus](#):
>
> python3 /usr/bin/mysql\_reset.py --reset

this command try to run it but nothing happens

- `python3 /usr/bin/mysql_reset.py --reset`

 ![image](https://global.discourse-cdn.com/wd/original/3X/0/3/03efae63e51d73e6b474eab6de920a19192147f0.png)

---

<div class="post-metadata">

**Author:** ![lalajee](https://avatars.discourse-cdn.com/v4/letter/l/a9a28c/32.png) [@lalajee](https://community.wd.com/u/lalajee)\
**Post date:** [November 3, 2023, 12:32am UTC](https://community.wd.com/t/unable-to-login-to-mysql-after-the-fireware-update-mysqli-real-connect-hy000-2002-connection-refused/286515/18 "2023-11-03T00:32:40Z")

</div>

I have, also updated phpmyadmin and login again but same issue. I think it’s an issue with new firmware

---

<div class="post-metadata">

**Author:** ![lalajee](https://avatars.discourse-cdn.com/v4/letter/l/a9a28c/32.png) [@lalajee](https://community.wd.com/u/lalajee)\
**Post date:** [November 3, 2023, 10:04pm UTC](https://community.wd.com/t/unable-to-login-to-mysql-after-the-fireware-update-mysqli-real-connect-hy000-2002-connection-refused/286515/19 "2023-11-03T22:04:57Z")

</div>

Anything else I can do to fix this issue

---

<div class="post-metadata">

**Author:** ![lalajee](https://avatars.discourse-cdn.com/v4/letter/l/a9a28c/32.png) [@lalajee](https://community.wd.com/u/lalajee)\
**Post date:** [November 3, 2023, 11:17pm UTC](https://community.wd.com/t/unable-to-login-to-mysql-after-the-fireware-update-mysqli-real-connect-hy000-2002-connection-refused/286515/21 "2023-11-03T23:17:43Z")

</div>

> [@Cerberus](#):
>
> pidof mariadbd

This command didnt return anything

- `pidof mariadbd`

I also done system restore

 ![image](https://global.discourse-cdn.com/wd/original/3X/9/f/9f60fa649d39774f45fdfd7f5b301109b1540b69.png)

Still same issue, Cant login

---

<div class="post-metadata">

**Author:** ![lalajee](https://avatars.discourse-cdn.com/v4/letter/l/a9a28c/32.png) [@lalajee](https://community.wd.com/u/lalajee)\
**Post date:** [November 3, 2023, 11:19pm UTC](https://community.wd.com/t/unable-to-login-to-mysql-after-the-fireware-update-mysqli-real-connect-hy000-2002-connection-refused/286515/22 "2023-11-03T23:19:32Z")

</div>

Is it possible to completely remove sql and reinstall it again

---

<div class="post-metadata">

**Author:** ![Joerg70](https://avatars.discourse-cdn.com/v4/letter/j/34f0e0/32.png) [@Joerg70](https://community.wd.com/u/Joerg70)\
**Post date:** [January 20, 2024, 5:46am UTC](https://community.wd.com/t/unable-to-login-to-mysql-after-the-fireware-update-mysqli-real-connect-hy000-2002-connection-refused/286515/24 "2024-01-20T05:46:05Z")

</div>

Yes, the WD support answered.  
Here you can see how to remove mysql.

> [@Error Mysql/MariaDB root login reset to start with MySQL/MariaDB](http://community.wd.com/t/error-mysql-mariadb-root-login-reset-to-start-with-mysql-mariadb/287650/14):
>
> OK, here is the final solution. The database was corrupted and the WD Support recommended to remove the MySQL Database . Save your data (just a recommendation from my side…I waited and did buy an external HDD…what I always wanted , because it is strongly recommended) 2.Login via SSH as root on the Device How to Access WD My Cloud Using SSH (Secure Shell) Remove the Database with SSH command: rm -rf /mnt/HD\_a4/.@database@/\* Switch the Network Database OFF and ON. (I personally dei…

---

<div class="post-metadata">

**Author:** ![Joerg70](https://avatars.discourse-cdn.com/v4/letter/j/34f0e0/32.png) [@Joerg70](https://community.wd.com/u/Joerg70)\
**Post date:** [October 30, 2024, 3:43pm UTC](https://community.wd.com/t/unable-to-login-to-mysql-after-the-fireware-update-mysqli-real-connect-hy000-2002-connection-refused/286515/25 "2024-10-30T15:43:37Z")

</div>

The last post is NO SOLUTION.  
Meanwhile I tried almost everything.  
I cannot get phpmyadmin available.  
It is installed (for the x-th time), but it is always the same - no access with the root / admin or whatsoever passwort (or even no passwort).
