WD Community

Cant't access to mySql database HY000/2002 error

I’m using mysql and phpMyAdmin for indexing my pictures library with Digikam, as descripted here, but now i can’t access to the database anymore, neither using phpMyAdmin, nor with ssh. I read the error mysqli::real_connect(): (HY000/2002): Connection refused.


mysql -u user
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

So i did a password reset as written here

How to install the phpMyAdmin App on a My Cloud with firmware 2.30.165 and higher

python3 /usr/bin/mysql_reset.py -r
MySQL DataPath: /mnt/HD_a4/.@database@
Removing /mnt/HD_a4/.@database@/mysql folder.
[startup-mysql] MySQL database (mysql) not found, creating database fo MySQL (mysql)...
211108 07:08:45 mysqld_safe Logging to '/mnt/HD_a4/.@database@/MyCloudEX2Ultra.err'.
211108 07:08:45 mysqld_safe Starting mysqld daemon with databases from /mnt/HD_a4/.@database@
root@MyCloudEX2Ultra ~ # Version check failed. Got the following error when calling the 'mysql' command line client
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
FATAL ERROR: Upgrade failed

Mysql partition it’s almost full

df -h /mnt/HD_a4
Filesystem                Size      Used Available Use% Mounted on
/dev/sda4               928.9M    912.5M    404.0K 100% /mnt/HD_a4

How can I do?

I’ve done a hard factory reset, with no success. Is there a way to reset mysql database?

Of course it is. Yesterday everything worked perfectly until the sda4 partition got filled up.

python3 /usr/bin/mysql_reset.py -r

Same problem

root@MyCloudEX2Ultra ~ # python3 /usr/bin/mysql_reset.py -r
211113 08:22:26 mysqld_safe Logging to '/mnt/HD_a4/.@database@/MyCloudEX2Ultra.err'.
211113 08:22:26 mysqld_safe Starting mysqld daemon with databases from /mnt/HD_a4/.@database@
211113 08:22:36 mysqld_safe Logging to '/mnt/HD_a4/.@database@/MyCloudEX2Ultra.err'.
211113 08:22:36 mysqld_safe Starting mysqld daemon with databases from /mnt/HD_a4/.@database@
211113 08:22:46 mysqld_safe Logging to '/mnt/HD_a4/.@database@/MyCloudEX2Ultra.err'.
211113 08:22:46 mysqld_safe Starting mysqld daemon with databases from /mnt/HD_a4/.@database@
No detect MySQL: status set 0 into xml config.
root@MyCloudEX2Ultra ~ # mysql -u root
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
Support for Western Digital Hard Drives | Western Digital

Still Need Help?

Reach out to Support for more assistance.

Sign in to Your Support Account

Get up-to-date information about your products.

Western Digital Business Portal

Unlock benefits and tools for your business such as enterprise support, pricing and rebate tools, marketing, loyalty, rewards, and more.