Search code examples
phpmysqlcodeignitermysql-connect

Changing the mysql.sock


I am new to codeigniter and i am installing this shopping cart that is written in codeigniter 2.0 and i have the database created and when i try to run i get this error

 An error #2 occurred in script '/Users/tamer/Sites/community-cart/system/database/drivers/mysql/mysql_driver.php' on line 70:

mysql_connect(): [2002] No such file or directory (trying to connect via unix:///var/mysql/mysql.sock) Date/Time: 4-8-2011 07:58:59

i seems to be looking for mysql.sock in the location here var/mysql/mysql.sock....but my local version is located at /tmp/mysql.sock and i cant seem to find out where to change that in codeigniter...

BTW: i am using maxosx 10.6 snow leopard


Solution

  • Look for the mysql_default_socket directive in the php.ini file (in OS X 10.6 it is in the /private/etc directory by default) and edit its value to point to correct location of the sock file. http://www.php.net/manual/en/mysql.configuration.php#ini.mysql.default-socket