Sorry for the post size, but alas, I decided to do a sudo apt-get update & sudo apt-get dist-upgrade and have hit the original emoncms web connection refused that I posted. (Noted that during upgrade ‘mariadb’ seemed to have issues.)
Can’t connect to database, please verify credentials/configuration in settings.php
Error message: Connection refused
Checked settings.php, looked fine. Also tried restoring file from the default. Data still pushing to remote emoncms. Assuming that auth credentials are as expected:
//1 #### Mysql database settings
$server = "127.0.0.1";
$database = "emoncms";
$username = "emoncms";
$password = "emonpiemoncmsmysql2016";
$port = "3306";
// Skip database setup test - set to false once database has been setup.
$dbtest = true;
//2 #### Redis
$redis_enabled = true;
$redis_server = array( 'host' => 'localhost',
'port' => 6379,
'auth' => '',
'prefix' => '');
//3 #### MQTT
// The 'subscriber' topic format is rx/* - where * is the emoncms input node number.
// The 'publisher' topic format is user selectable from the 'Publish to MQTT' input process, for example power/solar
$mqtt_enabled = true; // Activate MQTT by changing to true
$mqtt_server = array( 'host' => 'localhost',
'port' => 1883,
'user' => 'emonpi',
'password' => 'emonpi2016',
'basetopic'=> 'emon'
);
I am not sure if something has been overwritten to now lock me out of emoncms local instance. Do I need to fix mariadb or reset mysql/mqtt credentials somehow - if so, how?
Also get the following if relevant:
pi@emonpi:/var/www/emoncms $ sudo systemctl start mysqld
Job for mariadb.service failed because the control process exited with error code.
See "systemctl status mariadb.service" and "journalctl -xe" for details.
pi@emonpi:/var/www/emoncms $ sudo systemctl status mariadb.service
● mariadb.service - MariaDB 10.1.37 database server
Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2019-02-12 21:49:05 AEDT; 57s ago
Docs: man:mysqld(8)
https://mariadb.com/kb/en/library/systemd/
Process: 1808 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=1/FAILURE)
Process: 1725 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= || VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ] && systemctl set-environment _WSREP_START_POSITION=$VAR
Process: 1720 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Process: 1718 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
Main PID: 1808 (code=exited, status=1/FAILURE)
Status: "MariaDB server is down"
CPU: 519ms
Feb 12 21:49:03 emonpi systemd[1]: Starting MariaDB 10.1.37 database server...
Feb 12 21:49:05 emonpi mysqld[1808]: 2019-02-12 21:49:05 1988849664 [Note] /usr/sbin/mysqld (mysqld 10.1.37-MariaDB-0+deb9u1) starting as process 1808 ...
Feb 12 21:49:05 emonpi mysqld[1808]: 2019-02-12 21:49:05 1988849664 [Warning] Can't create test file /home/pi/data/mysql/emonpi.lower-test
Feb 12 21:49:05 emonpi systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Feb 12 21:49:05 emonpi systemd[1]: Failed to start MariaDB 10.1.37 database server.
Feb 12 21:49:05 emonpi systemd[1]: mariadb.service: Unit entered failed state.
Feb 12 21:49:05 emonpi systemd[1]: mariadb.service: Failed with result 'exit-code'.