Database connection failed!

when I try to login my journal website, I get white screen error saying database connection failed. However time to time I m able to see my webpage without login. Is there any idea about the problem ?

Thanks,

and here the error logs :

> [Mon Jul 04 09:31:33 2016] [error] [client 143.169.146.58] [host www.ejers.org] FastCGI: server "/homez.2305/ijeecsneht/www/index.php" stderr: PHP message: ojs2: Database connection failed!
> [Mon Jul 04 09:33:27 2016] [error] [client 143.169.146.58] [host ejers.org] FastCGI: server "/homez.2305/ijeecsneht/www/index.php" stderr: PHP message: ojs2: Database connection failed!, referer: http://ejers.org/index.php/ejers
> [Mon Jul 04 09:33:30 2016] [error] [client 143.169.146.58] [host ejers.org] FastCGI: server "/homez.2305/ijeecsneht/www/index.php" stderr: PHP message: ojs2: Database connection failed!
> [Mon Jul 04 09:38:10 2016] [error] [client 213.186.33.62] [host ejers.org] FastCGI: server "/homez.2305/ijeecsneht/www/index.php" stderr: PHP message: ojs2: Database connection failed!
> [Mon Jul 04 09:38:14 2016] [error] [client 213.186.33.62] [host ejers.org] FastCGI: server "/homez.2305/ijeecsneht/www/index.php" stderr: PHP message: ojs2: Database connection failed!
> [Mon Jul 04 09:40:24 2016] [error] [client 143.169.146.58] [host ejers.org] FastCGI: server "/homez.2305/ijeecsneht/www/index.php" stderr: PHP message: ojs2: Database connection failed!
> [Mon Jul 04 09:43:26 2016] [error] [client 143.169.146.58] [host ejers.org] FastCGI: server "/homez.2305/ijeecsneht/www/index.php" stderr: PHP message: ojs2: Database connection failed!

Hi @zaratushtra,

This simply says that PHP cannot connect to the MySQL database. I’d suggest reviewing your MySQL logs and settings to see if something is wrong there.

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

Dear asmecher,

I also experienced a database connection failed. error is below
03-03-08 19: 31: 06.606542 [INFO] [115.178.238.10:49332] File not found [/home/livaesls/ojs.sttjaffray.ac.id/404.shtml]
03-03-08 19: 31: 06.606507 [INFO] [115.178.238.10:49332] File not found [/home/livaesls/ojs.sttjaffray.ac.id/public/journals/4/homepageImage_id_ID.jpg]

Please solution

1 Like

Hi @hengki,

As above, this just means that MySQL rejected your database name, username, host name, and password combination. Make sure that you have run a GRANT statement in MySQL with the appropriate credentials. (Those error log entries are not related to this.)

Regards,
Alec Smecher
Public Knowledge Project Team

I have same problem. OJS 3.2.1.1
How can I solve?

Database connection failed!

ojs2: Database connection failed!

1 Like

Hi @Gokmen_ARSLAN,

Check the existing suggestions; if they don’t solve the problem, follow up here with what you tried and what the result was.

Regards,
Alec Smecher
Public Knowledge Project Team

Thank you, Alec.
I checked all but have not solved it. After that, I moved my hosting to new. The problem was automatically solved.