SQLSTATE[HY000] [2002] Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2)

http://www.magentocommerce.com/boards/viewthread/136/

 

Support for non standard port or unix socket will be available in next release.

Meanwhile you can replace these 2 files:
Mysql.php: lib/Varien/Db/Adapter/Pdo/Mysql.php
Mysqli.php: lib/Varien/Db/Adapter/Mysqli.php

Specify non-standard port like this:

localhost:3307

For unix socket use only the path in DB host field during install:

/tmp/mysql5.sock

You can also try changing the driver Magento will access mysql in app/etc/config.xml:

<type>mysqli</type>

There are driver types under <core_setup> (used during install/upgrade) and <core_write> (used during normal operation). Possible values are mysqli and pdo_mysql

 

File Attachments
Mysql.php  (File Size: 5KB – Downloads: 907)
Mysqli.php  (File Size: 5KB – Downloads: 569)

Magento Developer Knowledge Links

Magento for Developers
http://www.magentocommerce.com/knowledge-base/entry/magento-for-dev-part-1-introduction-to-magento

Magento API
http://www.magentocommerce.com/api/soap/introduction.html

Magento Documentation (phpdoc) Varien Lib Documentation
http://docs.magentocommerce.com/

Others
https://www.yireo.com/tutorials/magento/magento-programming/629-connecting-to-magento-with-soap-part-1
http://stackoverflow.com/questions/8569275/magento-retrieve-highest-product-price-in-current-collection-from-layered-nav

http://www.webdosh.net/2011/04/magento-get-skin-url-get-media-url-get.html