I know remote connections to MySQL are blocked in the free hosting so you can’t remotely connect but since your script is on your hosting I’m not sure why it can’t access the database.
Yes, phpmyadmin is working. This happened last time where phpmyadmin was working but was unable to connect with php [1]. Then, was able to connect the very next day.
Any changes to firewall rules at your end? or upgrades?
When I try to open phpMyAdmin [2], it gives me a blank page. I do NOT see “mysql8.000webhost” anywhere on [1]. Others seem to have problems connecting [3,4]. Not sure what else I can do? reach out to community?
I am also experiencing the same issue. I went through any other fix that I could find (change pwd, new db, even reinstalling wordpress), but no success.