I am using Pagodabox PHP cloud platform where we HAVE TO indicate which socket to use to connect to MySQL. Here is the config file where I indicate to use my socket.
The constants are correctly set, so the DB_SOCK = "/tmp/mysql/mydbname.sock". However, I keep receiving the following error:
Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'
So, I suppose that Yii does not pass user defined socket value to the PDO driver, which in this case uses its default "/var/run/mysqld/mysqld.sock".
Can you confirm that this is a Yii bug and if there is a fix for it, otherwise, I am stuck. There is no way to connect to DB without indicating the socket.
If I change localhost to 127.0.0.1 I start getting another error:
CDbConnection failed to open the DB connection: SQLSTATE[HY000] [2013] Lost connection to MySQL server at 'reading initial communication packet', system error: 110
And it never fades away, i.e. no way to establish successful connection.
It’s highly likely that this is something to do with user defined socket passing to a PDO. I feel like Yii forgot to pass it through. Changing to 127.0.0.1 - I don’t think it would solve, there is no big reason for it to influence the work.