SOLVED Database connection error (3)

Need help with the Administration of your Joomla! 2.5 site? This is the spot for you.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Locked
tsfirefly
Joomla! Apprentice
Joomla! Apprentice
Posts: 13
Joined: Mon Feb 20, 2012 3:51 am

SOLVED Database connection error (3)

Post by tsfirefly » Sun Feb 26, 2012 6:00 am

I created my website on localhost, uploaded it to the remote server, everything is fine. Website is live and working perfectly. Last night it was all just fine on localhost, too.

However, tonight I tried to make minor changes on localhost only, but I can no longer access it. I get the error message "Database connection error (3): Could not connect to database." I've searched the forums but haven't found an instance where the website is working on the remote server but NOT localhost.

I've checked my configuration.php file on localhost, and everything looks just fine. I've made no changes in the past 24 hours.

If it helps, the live site is http://www.calnevaleague.com. But my issue is on localhost only.

What should I do?

Thanks in advance.
Last edited by humvee on Sat Aug 18, 2012 11:14 am, edited 2 times in total.
Reason: Marked as resolved as per OP

User avatar
toivo
Joomla! Master
Joomla! Master
Posts: 10636
Joined: Thu Feb 15, 2007 5:48 am
Location: Oxford, UK
Contact:

Re: Database connection error (3) -- but last night it was f

Post by toivo » Sun Feb 26, 2012 9:28 am

The error code 3 means that Joomla can connect to the MySQL server using the username and password from the database settings, but is unable to select the database. In other words, the database name could be wrong or the user does not have access to that particular database.
Toivo Talikka, Global Moderator
troubleshooting smtp and other articles https://talikka.com/joomla

brn2drv99
Joomla! Intern
Joomla! Intern
Posts: 87
Joined: Fri Feb 24, 2012 11:24 pm
Location: MN, USA
Contact:

Re: Database connection error (3) -- but last night it was f

Post by brn2drv99 » Sun Feb 26, 2012 9:28 am

Recently, my configuration.php file permissions changed on their own (I at least don't know the cause), which lead me to a similar error you're experiencing. Perhaps check them, ensure you have full access rights?
Douglas A. Crosby
Owner of daCrosby, LLC
http://www.daCrosby.com

tsfirefly
Joomla! Apprentice
Joomla! Apprentice
Posts: 13
Joined: Mon Feb 20, 2012 3:51 am

Re: Database connection error (3) -- but last night it was f

Post by tsfirefly » Sun Feb 26, 2012 10:07 pm

Could it be anything else? I've checked and I have full privileges for all databases.

In localhost/phpMyAdmin I show some databases that were not there before...I'll delete them, for starters. However, could this be an issue of having a database "localhost" AND a database 127.0.0.1?

Thanks...

User avatar
toivo
Joomla! Master
Joomla! Master
Posts: 10636
Joined: Thu Feb 15, 2007 5:48 am
Location: Oxford, UK
Contact:

Re: Database connection error (3) -- but last night it was f

Post by toivo » Sun Feb 26, 2012 10:13 pm

'localhost' and '127.0.0.1' are addresses of the MySQL server, they mean the same thing. A database or database schema has to have a different name, which you have given.
Toivo Talikka, Global Moderator
troubleshooting smtp and other articles https://talikka.com/joomla

tsfirefly
Joomla! Apprentice
Joomla! Apprentice
Posts: 13
Joined: Mon Feb 20, 2012 3:51 am

Re: SOLVED Database connection error (3)

Post by tsfirefly » Sun Feb 26, 2012 10:15 pm

Thanks again -- this is making more and more sense to me, thanks to the experts on these forums. :)

tsfirefly
Joomla! Apprentice
Joomla! Apprentice
Posts: 13
Joined: Mon Feb 20, 2012 3:51 am

Re: SOLVED Database connection error (3)

Post by tsfirefly » Sun Feb 26, 2012 10:17 pm

Not sure how it happened, but it works now. Perhaps I didn't save the config.php file the first time I checked the db name, but now it's working.

Thanks again.

LeLampiste
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Tue Sep 18, 2012 4:34 pm

Re: SOLVED Database connection error (3)

Post by LeLampiste » Tue Sep 18, 2012 4:49 pm

Hello, all of you, great experts
I got this error (3) in a very special case : I developped on Win7 (use of 127.0.0.1) on a brand new installation of easyphp 12.1. Everything is ok.
I downloaded all (mysql and files) on my Synology NAS. It used to work before the php update but don't anymore.
To try something, I installed a new site of Joomla2.5.6 on the NAS with the sample test provided.
It works !
I then compared the two configuration.php and they look exactly the same, except of course $sitename, $db, $dbprefix, $secret, $fromname, $log_path and $temp_path. Rights are identical for both db (admin, ALL_PRIVILEGES).
127.0.0.1 was replaced with localhost on both.

Apache/2.2.22 (Unix) PHP/5.3.15
Version du client de base de données: libmysql - 5.1.49
Extension PHP: mysqli

Where should I look at ? How to test another way ?
Thanks in advance for some keys


Locked

Return to “Administration Joomla! 2.5”