Log to local mysql server

Is it possible to have emonpi log data to a local mysql instance rather than direct to the sdcard? If so where do i change the host name ?

I also notice that the default host listed on the admin page under MYSQL is localhost:6379 ? Is this right? I though the default port was 3306.



Welcome Pete to the OEM forum.

What do you mean by

In emonCMS, MySQL is only used for the metadata, the actual data storage is in a home-brew database, details at Learn→Electricity Monitoring→Timeseries.
The data from the ‘emon’ part of the emonPi and other sensing nodes is normally received by emonHub, checked and sent to emonCMS. The emonPi can store the data in its own emonCMS on its own SD card, or send it to a remote emonCMS, or both. The remote can be emoncms.org or it can be emonCMS running on your own server (not the emonPi, but that could be another Raspberry Pi). That is set up in emonhub.conf.


Thanks for clarifying. Just received my emonpi and finding my way around…


SQL not generally used for the data storage, but used for the system info, users, dashboards etc.

That data store though, is on the SDCard.

I believe mysql was used for data storage originally, but was replaced because of its poor performance for this application. So you might find some mention of it in old articles.

You could put the data on another host by NFS-mounting a suitable directory to the pi. Or you can leave it on the pi and copy it somewhere else at intervals. I use scp to make a backup of the data every night.