In an attempt to uninstall unwanted and unused programs running and taking up space and memory on the same Pi as my Emoncms I seem to have broken it… (why did I touch it? It has been working just fine for a couple of years… )
I am getting the error:
Can’t connect to database, please verify credentials/configuration in settings.php Error message: Connection refused
I have looked at the configuration in settings.php and it looks fine to me. I have googled it with no luck. Any suggestions?
Search on “Can’t connect to database, please verify credentials/configuration in settings.php*
*Error message: Connection refused” gives a number of threads e.g.
Yea, I am good at bad ideas - i’m tinkering on the limit of my understanding and do make these kinds mistakes. The Web UI is not working - I just get the error above - so that is why I did not update from the UI.
I just tried this:
pi@emonpi:~ $ cd backup
pi@emonpi:~/backup $ ./emoncms-export.sh
=== Emoncms export start ===
Thu 31 Dec 16:27:00 UTC 2020
Backup module version:
“version” : “1.1.5”
EUID: 1000
Reading /home/pi/backup/config.cfg…
Location of mysql database: /home/pi/data
Location of emonhub.conf: /home/pi/data
Location of Emoncms: /var/www/emoncms
Backup destination: /home/pi/data
Image version: emonSD-30Oct18
mysqldump: Got error: 2002: “Can’t connect to local MySQL server through socket ‘/home/pi/data/mysql/mysql.sock’ (2 “No such file or directory”)” when trying to connect
Error: failed to export mysql data
emoncms export failed
Does that mean that the database is missing? Or that it just could not connect to it?
I’ll flash another SD card with a fresh Emon image on it.
I’m not sure how to get at the old database (if it is still there) from the old SD card, I’ll come back to you if I cannot work it out.