Page 1 of 1

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

Posted: Mon Apr 13, 2015 1:15 pm
by avinashjto04
Hi,

Once in a while I am getting error "Database connection error (2): Could not connect to MySQL." for my Joomla site. I checked Configuration file, everything is configured perfect.
Some time site works, some time not. i am not able to figure out what's the exact problem is?
Could any one please help me to get this issue resolved.

Thanks in advance!
Avinash

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

Posted: Mon Apr 13, 2015 2:05 pm
by conlippert
I would check your server error log and see if there is any error messages before the time of the connection error. Also, when you say it sometimes works, does that mean it works for a while on the same page for example, the home page and then suddenly the connection drops? This could mean a problem with the host.

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

Posted: Mon Apr 13, 2015 2:50 pm
by avinashjto04
Yes Exactly same thing is happening as you maintained in your example.I also had word with my host provider, they are saying there might be problem with Application, However from my end application is running well.so i am confused now.
Could you please help me out to get this issue solved.
Please let me know if you want any thing in this regard.

Thanks,
Avinash

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

Posted: Mon Apr 13, 2015 3:13 pm
by conlippert
Is there any messages in the error log before the connection times out? How many times has it timed out in the last week? You can also turn on the debug in the administrator and it will give you all the sql results.

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

Posted: Mon Apr 13, 2015 3:38 pm
by avinashjto04
Just now i checked, after connection time out i am getting same error "Database connection error (2): Could not connect to MySQL." i can't give you exact count of how many time it timed out in a last week.
How would i turn on the debug in the administrator.
Please advise!

Thanks,
Avinash

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

Posted: Mon Apr 13, 2015 3:54 pm
by avinashjto04
I turned on the debug in administrator. I am getting below error "Parsing errors in language files"
Is this the root cause of my problem?
If Yes please suggest how can i remove this error.

Thanks,
Avinash

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

Posted: Mon Apr 13, 2015 4:32 pm
by conlippert
Parsing errors sound like your template is a problem. What template are you using? Here is a post on the same problem. http://forum.joomla.org/viewtopic.php?f=617&t=827828

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

Posted: Tue Apr 14, 2015 12:52 pm
by avinashjto04
Still i am getting same error.i don't want this problem should be repeated again and again.
Is there any alternative method to remove it.
Please help.

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

Posted: Tue Apr 14, 2015 1:35 pm
by conlippert
You could try moving the site to a different server and see if you get the same thing. If you post your URL I'll look at it and see if I notice anything.

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

Posted: Tue Apr 14, 2015 2:26 pm
by avinashjto04
I do have single server at that time, so i can't move to a different server.
http://bindassstudent.com/bindass-student/

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

Posted: Tue Apr 14, 2015 3:28 pm
by conlippert
Looked at all I could with out creating a login but never got the connection error. Maybe you could test on desktops and come up with some pattern of occurance. That would be the best clue as to what is causing your problem. I think the parsing error in the language files is a secondary problem so you should work on that in another post on the forum. From my experience, if an error message comes up unpredictably it's not the application. Unpredictable is usually due to a bad internet connection or some problem at the server level especially if you are on a shared server. Unless you can reproduce the problem with predictable elements, it's pretty much a guessing game.

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

Posted: Wed Apr 15, 2015 6:58 pm
by jcms
maybe your server Mysql is not good. check it first and check value of memory_limit in your server.