solved ERROR: dbConnect() unable to connect to database server "localhost"

alt=
@andrusito
6 years ago
302 posts
Just today I found one of my sites with this

ERROR: dbConnect() unable to connect to database server "localhost"
MySQL error 1045 - Access denied for user 'mysite_jamroom'@'localhost' (using password: YES)

I tried this but did not work: https://archive.jamroom.net/Jamroom4_Change_MySQL_Password

I guess because I have installed JR5..?
updated by @andrusito: 01/24/19 12:37:50PM
michael
@michael
6 years ago
7,744 posts
If it was working and you did nothing, contact your hosting provider.

If it was working and you changed something in the database, may need to check that database still exists and possibly restore from a backup.

If it was working and you changed something in the file system check that you have the correct details in your config file found at /data/config/config.php
paul
@paul
6 years ago
4,330 posts
Where did you install JR5? If it was into a subfolder and with a separate new database it should be ok.
If you installed it ‘on top’ of JR4 that could well be the problem.


--
Paul Asher - JR Developer and System Import Specialist
alt=
@andrusito
6 years ago
302 posts
Thanks, guys...

the thing is I did not find at /data/config/config.php

Yes, I upgraded from JR4 long time ago... but it's installed on main folder, on top of JR4...

Where should be the database details so I can change them?
paul
@paul
6 years ago
4,330 posts
/data/config/config.php


--
Paul Asher - JR Developer and System Import Specialist
alt=
@andrusito
6 years ago
302 posts
thanks, Paul... I did not find /data/config/config.php so this is definitely JR4.

I went to https://archive.jamroom.net/Jamroom4_Change_MySQL_Password again

I do not have a "settings.zip" file but a "settings.tar.gz" file.

I took the steps but I get the same "ERROR: dbConnect() unable to connect to database server "localhost"..." when going to mysite.com/settings.php

changed permissions from 0644 to 777 but I get the same...

Is there any other way to change dB info?
michael
@michael
6 years ago
7,744 posts
JR4 is only going to run on php up to php 5.2. Anything newer than that and it wont run properly. It MIGHT be an issue with the mysql version on the server. Just a guess, but if the mysql() set of functions are not on the server because its too new, that might be the cause of the issue.

At some point after JR4 phps 'mysql' set of functions got replaced with 'mysqli' set of functions. If your server does not have the older set of mysql functions that may be the issue.

Tags