Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ on Zend Framework

Error :
Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’

the solution is change the following lines

ubuntu@ip-10-128-138-137:~$ cat /srv/www/xxx/application/configs/application.ini | grep resources.db
resources.db.adapter         = "PDO_MYSQL"
resources.db.params.host     = "localhost"
resources.db.params.username = "xxx"
resources.db.params.password = "xxxpass"
resources.db.params.dbname   = "xxxdb"
resources.db.params.profiler.enabled = true
resources.db.params.profiler.class = Zend_Db_Profiler_Firebug
resources.db.params.driver_options.1002 = "SET NAMES utf8"

into

ubuntu@ip-10-128-138-137:~$ cat /srv/www/xxx/application/configs/application.ini | grep resources.db
resources.db.adapter         = "PDO_MYSQL"
resources.db.params.host     = "127.0.0.1"
resources.db.params.username = "xxx"
resources.db.params.password = "xxxpass"
resources.db.params.dbname   = "xxxdb"
resources.db.params.profiler.enabled = true
resources.db.params.profiler.class = Zend_Db_Profiler_Firebug
resources.db.params.driver_options.1002 = "SET NAMES utf8"
Advertisements