Cdbconnection Failed To Open The Db Connection


Im having a trouble after uploading my app to a server. In my local server every thing goes OK, I have complete my work and the site is working well.

When I’ve uploaded to the web server, I changed the settings database and always appears the following error:

CDbConnection failed to open the DB connection: SQLSTATE [HY000] [2002] Can not connect to local MySQL server through socket ‘/ var / run / mysqld / mysqld.sock’ (2)

I test the connection to the database via a link normal PHP:

$ link = mysql_connect ('MySQLServer', 'user', 'pass');

And it works, so I know the parameters are right.

What could I’m possible doing wrong?


Have you verified the requirements on the Web server?

Have you tried this?

You can also see this QA, maybe it’ll help?

hi you can specify the mysql socket path manualy

since mysql uses /tmp/mysql.sock by default should fix it