Unable to connect to Database
-
Hi all.
I am 3 days into a few site (my first WP so a newb). But the site is unstable. I am exhausted in trying to fix what it could be. I think it’s the host (but am not sure). I have reached out to a new host who I may need to transfer to as a result.
But any ideas what could cause this?
My concern is – if my fault when I transfer I will still have the same issue.
Basically the site “locks” for 5 minutes then unlocks and is fine again. When it is locked – it displays the database connection error message (same for WP-Admin).
Database size is 1 MB. I have 4-5 posts on the site. All tables are optimised.
I have contacted the host (Powweb) and they can’t find any issue so I am logging each downtime on a support ticket in case they can find a pattern with their engineers. I did look at the server they are hosting me on and the items below under Database / Server were in Red (but I am not a DBA or IT person so have no clue whether these are a cause for concern).
Symptom
Website cannot connect to database.
Locks for circa 5 minutes with the error message then releases on it’s own accord. Rinse/Repeat some hours later.
Always occurs if I update anything on WP – e.g. delete a plugin – immediately afterwards database will lock up for 5 minutes then release.
Occurs for visitors multiple times a day even if site is untouched for hours by me.Traffic
Low volume
Memory – in parameters set
Usage – in parameters set
Size – streamlined.
(all per host knowledge base – they have a limit of 7.5K an hour on the database which I can’t see stats for but believe I am under based on the visitors/robots – I am a very low visitor website).Things I have ruled out
WP-Config – no typo/all information correct.
Plugins – removed all – still happens – now have 3 back on – not better or worse.
– AddToAny: Subscribe Button, GT3 Page Builder, Link Manager
Reinstalled theme and have latest WP version.
Security is ok not hacked – have renamed database tables away from WP. Have appropriate permissions and htaccess set up.
Added Robot.txt file to ensure it’s not spiders eating up bandwidth etc.
Got host to check the details in WP-Config match database ok. There was an issue on day 2 where a password update didn’t work at the “back-end” on their side but it’s long been fixed and not resolved the continual locking.What I don’t have in place
CachingServer / Database
I checked the server and these red numbers are appearing:
Innodb_buffer_pool_reads 11 k The number of logical reads that InnoDB could not satisfy from buffer pool and had to do a single-page read.
Innodb_row_lock_time_avg 17 The average time to acquire a row lock, in milliseconds.
Innodb_row_lock_time_max 4 k The maximum time to acquire a row lock, in milliseconds.
Innodb_row_lock_waits 782 The number of times a row lock had to be waited for.
Handler_read_rnd_next 242 The number of requests to read the next row in the data file. This is high if you are doing a lot of table scans. Generally this suggests that your tables are not properly indexed or that your queries are not written to take advantage of the indexes you have.
Qcache_lowmem_prunes 102 M The number of queries that have been removed from the cache to free up memory for caching new queries. This information can help you tune the query cache size. The query cache uses a least recently used (LRU) strategy to decide which queries to remove from the cache
Binlog_cache_disk_use 6 k The number of transactions that used the temporary binary log cache but that exceeded the value of binlog_cache_size and used a temporary file to store statements from the transaction.
Table_locks_waited 320 k The number of times that a table lock could not be acquired immediately and a wait was needed. If this is high, and you have performance problems, you should first optimize your queries, and then either split your table or tables or use replication.
Thanks for taking time to read.
🙂
The topic ‘Unable to connect to Database’ is closed to new replies.