I have several (FREE) Heroku applications and they all use PHP and MySQL. However, on one of them, I constantly have problems with ClearDB (MySQL). I get the following error:
SQLSTATE [HY000] [2002] Unable to connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
When I try to connect to it from my local machine, it works fine. I tried to remove the ClearDB addon and add it again several times, but this did not solve the problem. This has been going on for about 3 weeks.
Here is my code:
public $production = array( 'datasource' => 'Database/Mysql', 'persistent' => false, 'host' => 'us-cdbr-east-04.cleardb.com', 'login' => 'username', 'password' => 'password', 'database' => 'heroku_9565d18e1870f97', 'prefix' => '',
and here is the url I get from Heroku / ClearDB
mysql://username: password@us-cdbr-east-04.cleardb.com /heroku_9565d18e1870f97?reconnect=true
Any ideas what to do now? Does my code look right? I probably can ask for support to Herku, but I would prefer to contact the community first, since now I donβt pay for Heroka.
source share