A temporary fix would be adding something like max_connections=250 to /etc/mysql/mariadb.cnf
A better solution would be finding out which program on your system is misbehaving and opening all those connections. See MariaDB max connections - Stack Overflow