Database Error

Site Url: olympia.rf.gd

Details of error:

A PHP Error was encountered

Severity: Warning
Message: mysqli::real_connect(): (HY000/2002): Connection timed out
Filename: mysqli/mysqli_driver.php
Line Number: 201
Backtrace:
File: /home/vol6_5/epizy.com/epiz_24301552/htdocs/application/controllers/Home.php
Line: 7
Function: __construct
File: /home/vol6_5/epizy.com/epiz_24301552/htdocs/index.php
Line: 315
Function: require_once

A Database Error Occurred

Unable to connect to your database server using the provided settings.
Filename: controllers/Home.php
Line Number: 7

I have double-checked the following and ensured they are correct in the config file:
db name, db username, db password, db hostname and db driver

I am trying to set up a custom built CMS but I got that error. Please help.

Are you trying to connect the DB on another server?

Please read this:
https://infinityfree.net/support/common-mysql-errors/

1 Like

Not really. The cPanel MySql page shows:
MySql DB name: epiz_24301552_cms
MySql hostname is sql210.epizy.com

but phpmyadmin says

MySql hostname: sql210.bycluster.com

In the config file, I decided to use the db hostname in phpmyadmin

Could this be the reason for the error? Will changing the db hostname fix the error?

sql210.epizy.com is the same as sql210.byetcluster.com

Please read the KB Article I sent above!!

1 Like

I did read the above KB article in detail. It does not cover the nature of the error I have. I could send you my config.php and database.php code for you to review. I do not mind. I have double checked everything.

If you wrote the software yourself, you should use something like mysqli_error or mysqli_connect_error (if you’re using MySQLi) or mysql_error (if you’re using the outdated MySQL library). Using the PDO library should throw a PDOException which you can print for more information.

Please do the above, this will reveal the error.

1 Like

Thanks

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