geckotech at October 10th, 2011 11:33 — #1
We have recently deployed the above LAMP stack to AWS
We found some contradictions/conflicts in base stack configuration relative to PHP and MySQL.
Specifically the following:
As you can see, MySQL believes that mysql.socket is in /tmp path (absolute)
Where as PHP sees mysql.socket in /opt/bitnami/mysql/tmp (absolute path, which is correct)
How can we fix this? (/opt/bitnami/mysql/my.cnf is showing the bitnami path correctly, but in PHP info showing something different)
beltran at October 11th, 2011 02:50 — #2
The first one is the default location and you can overwrite with an environment variable. The MySQL socket location is in "/opt/bitnami/mysql/tmp/mysql.sock". Could you post the exact error that PHP reported?
geckotech at October 11th, 2011 12:07 — #3
Thanks for the reply.
The error we are getting is:
Error : SQLSTATE[HY000]  Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) Error Number : 2002
Date : Oct 09 2011 23:01:22
Script : /
IP Address : 220.127.116.11
The my.cnf is not using the above path, so the above path shown in error is being set somewhere else.
beltran at October 11th, 2011 13:16 — #4
Usually you can configure the MySQL socket location in the application itself. As a workaround you can create a symlink to the default location:
$ sudo ln -s /opt/bitnami/mysql/tmp/mysql.sock /tmp/mysql.sock