Database connection error (2): Could not connect to Mysql

General questions relating to Joomla! 2.5. Note: All 1.6 and 1.7 releases have reached end of life and should be updated to 2.5. There are other boards for more specific help on Joomla! features and extensions.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Locked
kensh1n
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Wed Jan 25, 2012 8:12 am

Database connection error (2): Could not connect to Mysql

Post by kensh1n » Wed Feb 29, 2012 6:12 am

Help..my site is show random error message

"Database connection error (2): Could not connect to MySQL."

before that, the site is show nothing and work good

i had check my configuration.php and everything its ok

anyone can help me?please.. :(

User avatar
OSTechnologies
Joomla! Intern
Joomla! Intern
Posts: 89
Joined: Fri Aug 21, 2009 12:40 pm
Location: PA, USA
Contact:

Re: Database connection error (2): Could not connect to Mysq

Post by OSTechnologies » Wed Feb 29, 2012 6:19 am

Check with your server provider - it seems that MySQL server was down at that time.
Manish Mittal
Skype: manish.osuniverse
https://ost.agency - Joomla, PHP/MySQL Expert. Contact Us for your Open Source Projects.

kensh1n
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Wed Jan 25, 2012 8:12 am

Re: Database connection error (2): Could not connect to Mysq

Post by kensh1n » Wed Feb 29, 2012 12:26 pm

thanks OSTecnologies..
they say the mysql server is run..
i found some injection to my site.. the report from Marco's SQL Injection - LFI Interceptor Plugin

** Local File Inclusion [GET:option] => ../../../../../../../../../../../../../../../../proc/self/environ
** Local File Inclusion [REQUEST:option] => ../../../../../../../../../../../../../../../../proc/self/environ

**PAGE / SERVER INFO


*REMOTE_ADDR :
188.83.139.33

*HTTP_USER_AGENT :
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.2) Gecko/20100101 Firefox/10.0.2

*REQUEST_METHOD :
GET

*QUERY_STRING :
option=../../../../../../../../../../../../../../../../proc/self/environ



** SUPERGLOBALS DUMP (sanitized)


*$_GET DUMP
-[option] => proc/self/environ


*$_POST DUMP


*$_COOKIE DUMP


*$_REQUEST DUMP
-[option] => proc/self/environ

is this injection make my mysql disconnected?

kensh1n
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Wed Jan 25, 2012 8:12 am

Re: Database connection error (2): Could not connect to Mysq

Post by kensh1n » Wed Feb 29, 2012 12:49 pm

and another message is

** Local File Inclusion [GET:amp;fontstyle] => ../../../../../../../../../../../../../../../../etc/passwd
** Local File Inclusion [REQUEST:amp;fontstyle] => ../../../../../../../../../../../../../../../../etc/passwd

**PAGE / SERVER INFO


*REMOTE_ADDR :
190.201.200.138

*HTTP_USER_AGENT :
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.2) Gecko/20100101 Firefox/10.0.2

*REQUEST_METHOD :
GET

*QUERY_STRING :
option=com_content&task=view&id=29&Itemid=97&month=6&year=2008&lang=en&fontstyle=../../../../../../../../../../../../../../../../etc/passwd



** SUPERGLOBALS DUMP (sanitized)


*$_GET DUMP
-[option] => com_content
-[amp;task] => view
-[amp;id] => 29
-[amp;Itemid] => 97
-[amp;month] => 6
-[amp;year] => 2008
-[amp;lang] => en
-[amp;fontstyle] => etc/passwd


*$_POST DUMP


*$_COOKIE DUMP


*$_REQUEST DUMP
-[option] => com_content
-[amp;task] => view
-[amp;id] => 29
-[amp;Itemid] => 97
-[amp;month] => 6
-[amp;year] => 2008
-[amp;lang] => en
-[amp;fontstyle] => etc/passwd

larenge
Joomla! Apprentice
Joomla! Apprentice
Posts: 23
Joined: Thu Dec 08, 2011 9:03 am

Re: Database connection error (2): Could not connect to Mysq

Post by larenge » Thu Mar 01, 2012 1:46 pm

One of the reason for such kind of error is wrong database information in configuration.php file such as:

Code: Select all

public $dbtype = 'mysqli';
public $host = 'localhost';
public $user = 'root';
public $password = 'root';
public $db = 'test';
public $dbprefix = 'testdb_';
Check the database information such as host ,user ,password ,db ,dbprefix are correct.
You can check it in phpmyadmin.

For example if you provide wrong password above you will get this error.

lu35
Joomla! Apprentice
Joomla! Apprentice
Posts: 13
Joined: Thu Feb 02, 2012 5:04 pm

Re: Database connection error (2): Could not connect to Mysq

Post by lu35 » Thu Mar 08, 2012 11:56 am

The password reset thing in configuration.php did it for me. Thanks all.


Locked

Return to “General Questions/New to Joomla! 2.5”