Cdbconnection Failed To Open The Db Connection.

Hello All,

I have a site hosted in hostgator and recently they faced some network issues in datacenter which they fixed. Since then, I am unable to connect to my site. It is giving me ‘Error 500. CDbConnection failed to open the DB connection.’

I didn’t changed anything in my end. I have talked to hosting provider lots of time and they are saying that it is no problem at their end.

I tried connecting using mysql_connect(). And it does connect successfully. I checked for pdo extension and they seem to be enabled. I just could not figure out what might be gone wrong as it was working properly earlier.

Any shades of light in this issue would be very helpful.




does database name contains lower and capital letters ?

if php or mysql upgrated or change any configures may there are some issues with that

for example in my case, on localhost I have in mysql the table named ‘myTable’.

in model is defined as ‘mytable’ (tableName method) and it works fine!

but on my server I had to change to ‘myTable’, exactly as in mysql exists!

So I am wondering if you have an issue like mine.

I think it would help tremendously if you could set your application into debug mode once. Error messages tend to be much more descriptive :)

Thank you for you help!

It seem that the problem is due to the mysql version upgrade. The old user is not authenticated properly and need to reset the password for that.