"Random" Error establishing a database connection error on TMAC PowerStore

[Username (e.g. epiz_XXX) or Website URL]

(https://tmacpowerstore.great-site.net)

Error Message

(Error establishing a database connection)

Other Information

(Randomly when I visit my website it declares “Error establishing a database connection”. I am doing nothing, even on the main page or on the wp-admin. Again it is randomly happening, so do not recommend me an SQL error fix. Everything are configured correctly. I guess Infinity Free Databases go down our something. Anyways, can you give the URL of my database to monitor for a downtime. I need immediate help.)

Main Concern that needs immediate fix as soon as possible

(“Random” Error establishing a database connection error on TMAC PowerStore)

@Admin sorry for mentioning but my issue is really weird. Please do not mark this comment or close this feed as it may sound similar to other threads but mine presents another variation of the other thread.

That is a common error. Can you enable wp-debug?

And then give the error?

6 Likes

Really weird now my website shows white screen and loads way way slower but after still loads. Still not sure what caused that Database Error but maybe my plugin WP-Optimize which optimize my database. I will try to disable that functionality to optimize the database and see.

The WP-Optimize is not the cause of the random errors. Maybe Infinity Free’s Database is really down?

Can I backup my database and host the database instead outside of Infinity Free?

The load time of your website is normal for WordPress with few visitors. Changing hosts won’t really make a big difference, since the issue is with WP Cron, not the database.

As for an explanation for the slow loading, I like this analogy from @wackyblackie to explain it:

Imagine you have an old computer, you want to use it but it is off.
Now you have to wait for it to boot, which can take a while.
But once it’s booted, you can use it, and when it becomes idle, it responds quickly.
Eventually, it shouts off because you haven’t used it in a while, so the next time you want to use it, you must boot it up again.

What you can try is setting up a cron job in the control panel to load your homepage every hour or so. Also, turn off automatic updates, and disable plugins that run in the background, or create background tasks.

5 Likes

I will try to see.

Since I am a beginner in the web hosting community, can anyone give me the steps to do this:

Now I understand this one, so thank you:

2 Likes

On the control panel, find the “Cron Jobs” section. If required, select your domain name from the drop-down. For the URL box, enter “index.php” (I forget the exact location of the cron file since I don’t use WP, but the index file is sufficient to call).

Then enter “1” in the hour box, and “5” in the minute box, then submit it.

It may take a few days to a few weeks before you see a change. If the speed does not decrease, try changing the “5” to a different number (Cron jobs are a bit weird here).

4 Likes

I will try and will post back here if the website will not shutdown I mean like what the quotation means like my site will sleep. If the performance does not improve tomorrow, should I change 5 to a higher or lower number?

You can do that and your website will take even more performance hit (even slower)

1 Like

Talking about this:

So far, all we know is that there is “a database error”. Before we can figure out what’s causing it, we first need to know what the database error is in the first place. As in: the actual error message saying what specifically is wrong with the database connection.

You could, but database connections are very sensitive to latency, so even if you choose the fastest database hosting in the world, then your website will be very slow due to all the queries and data that need to travel to and from the database to your website server.

5 Likes

Okay, now not happens again thanks to this solution:

It is fast now to load my website, not stucking at a white screen for a very long time.

3 Likes

Glad to hear it!

3 Likes

When I add products on WooCommerce then the Database “Go Down”. Because WordPress says that there is error connecting to thrle database that has an address of I remember byteclusters. But still when just visiting the site and done nothing, there is now no Database Error. The error only appears after adding some information to the database using WooCommerce’s product adder. But after a refresh everything goes normal. Note: The database error now appear on the wp-admin (specifically WooCommerce) only and the main website is running normally. I guess I basically just overloaded the database that causes it to down for a few seconds. @Admin do we have limits on the no. of data that can enter on the database at a single time here at Infinity Free?

Again, it’s basically impossible to say why you get “a” database error if we don’t know what database error is happening.

There is a limit to the amount of data you can enter at once. This is the max_allowed_packet_size limit in MySQL, that basically dictates how big your SQL payload can be.

But if you can refresh the page and it works, I don’t think this is the issue.

4 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.