Ojs2: Database connection failed!

Hi there,

I am trying to open a project in localhost XAMPP (php7.3) and I have ojs2 on the project.

When I type my base_url on the browser I get…

Database connection failed!

error.

My Database Settings seems to be O.K.

What could it be?

First we need to be sure all is working fine in the DB side (server, user, pwd and dbname are correct).

To do this, the easiest way is downloading “adminer”, that is a DB management software build in a single php file.

So, please follow this steps:

  1. Download Adminer from their web.
  2. Upload this to your server’s root (in your case, you don’t need to upload… just place in your xampp root).
  3. Visit adminer webpage (in your case, would be "http://localhost/adminer.php or something like that).
  4. Fill with your DB credentials… and checking “mysql” in the System dropdown.

If you can reach your adminer, keep this credentials and review your config.inc.php to be sure there is no typo error or so.

Cheers,
m.

1 Like

Hi @Mustafa_A

To run Ojs2, make sure that the php version you are using is version <5.6, then the driver configuration used in config.inc.php is : mysql

image

2 Likes

Hi there Marc,

Thank you for ur replay.

I did what you just told, and when I give my credentials it says an error message:

“Access denied for user ‘admin’@‘localhost’ (using password: YES)”

I suppose that means my credentials are wrong?

Hi Muhammad_Al_Madani,

thank you for replaying on me.

I will do that to see what happens :smiley:

Yep. :sweat_smile:

I don’t know where is you OJS hosted, but user for mysql is not usually “admin”.
Check with your hosting service to confirm those credentials.
After this, you will be able to install without any trouble.

Come back here is you find new issues.

Cheers,
m.

This topic was automatically closed after 30 days. New replies are no longer allowed.