Server Version: 3.3.1 on Linux
DB being used: MariaDB (used same database since server version 3.1.0)

PHP Code:
2018-09-23 05:26:33.970127|ERROR   |DatabaseQuery |   |db_open() select from servers where server_port 9987errorCan't connect to MySQL server on '' (107)
2018-09-23 05:26:59.651464|ERROR   |DatabaseQuery |   |db_open() select distinct c.client_id, c.server_id from (clients c left outer jo error: Can'
t connect to MySQL server on '' (107 
PHP Code:
2018-09-23 06:36:12.245457|ERROR   |DatabaseQuery |   |db_open() select from clients where client_unique_id 'ServerQuery' and serve errorCan't connect to MySQL server on '' (107)
2018-09-23 06:50:07.845528|ERROR   |DatabaseQuery |   |db_open() select * from servers where server_port = 9987; error: Can'
t connect to MySQL server on '' (107

Above I simply copied some of the errors I was getting to showcase them to you, but they are repeated frequently, as you can see in the pictures below. Log file ends up being over 3000 lines of this, with the pictures only incorporating the top of the log file.
(1/2) Click image for larger version. 

Name:	WinSCP_2018-09-23_11-20-20.png 
Views:	55 
Size:	241.0 KB 
ID:	17137
(2/2) Click image for larger version. 

Name:	WinSCP_2018-09-23_11-21-53.png 
Views:	90 
Size:	249.3 KB 
ID:	17138

This all ends up resulting in the TeamSpeak client as '<11:10:53> database error' when I attempt to connect. This is currently happening about every 2 weeks for the past 2-3 months with a simple server restart resolving the issue temporarily.

A remedy to this issue would be much appreciated,