Large homeassistant database files

-sh: mysql: command not found

image

can’t use QNAP console for this then… you need to install mysqlclient in a different computer…

What is your:
SHOW VARIABLES LIKE 'max_connect_errors'
and
SHOW VARIABLES LIKE 'max_error_count'

Mine was 100 and 64, not sure if this was the issue, but I increased it to 100000 and 10000 and it worked on HA restart without restarting Qnap.

mine are 10 and 64

The issue is why are you getting connect_errors :confused:

That is the problem that should be addressed

I know, just not sure how to go about it.

For show variables like "max_connections" I have:
image

same 151

You need to look into the logs

I looked through the Binary Log, but didn’t see any entries for today.

Try:

show global status like ‘%abort%’;

show variables like “wait_timeout”;

show variables like “interactive_timeout”;

show global status like '%abort%'
image

show variables like 'wait_timeout'
image

show variables like 'interactive_timeout'
image

Do you use any other software to monitor mysql ? like Nagios ?

https://bugs.mysql.com/bug.php?id=24761

No, just the sql sensor in HASS

You need to go through this:

https://dev.mysql.com/doc/refman/5.7/en/communication-errors.html

Okay, this will be a while…

Thanks for all your assistance.

I was able to connect from the command line using root but not hass_db.

1 Like

I’m trying to install libmysqlclient-dev but it keeps giving me this error:

“Package libmysqlclient-dev is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source.”

Do you guys know if I have to update the sources.list ?

should I add

sudo install default-libmysqlclient-dev

Which Linux distribution are you using ?

You should refer to their community support

I was having the same issue, I’m running Hassbian. You need to uncomment the bottom line in your /etc/apt/sources.list, then do a “apt get update” and finally “apt-get install libmariadbclient-dev”

 $ cat /etc/apt/sources.list
deb http://raspbian.raspberrypi.org/raspbian/ stretch main contrib non-free rpi
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
deb-src http://raspbian.raspberrypi.org/raspbian/ stretch main contrib non-free rpi

Hope this helps.

Just wondering. How much memory is your MySQLd using ?
This is giving a nice output of all processes:

ps -eo size,pid,user,command --sort -size | awk '{ hr=$1/1024 ; printf("%13.2f Mb ",hr) } { for ( x=4 ; x<=NF ; x++ ) { printf("%s ",$x) } print "" }' |cut -d "" -f2 | cut -d "-" -f1

Mine is 600Mb and using a lot of my Pi memory.

Thanks!

My DB grew 40 MB per hour until I found out what sensors that caused it.
My Nodon switch created 35 000 entries per hour.

After excluding it, the DB now grows 0,7 MB/hour.

image

1 Like

What was the Nodon switch doing? How did you trace it back to that sensor?