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)
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s