Magento Forum

   
Install wizard configuration error: SQLSTATE[HY000] [2002] No such file or directory
 
GriffinTech
Jr. Member
 
Total Posts:  19
Joined:  2010-05-03
 

Have setup everything successfully before I changed my default MAMP environment to a Macports environment.

Now when I go through the install wizard, I’m getting this error on the Configuration step:

SQLSTATE[HY000] [2002] No such file or directory
Database connection error

Can anyone give me more details on why I’d be getting this error?
Thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
GriffinTech
Jr. Member
 
Total Posts:  19
Joined:  2010-05-03
 

Captcha sucks.

Check the mysql sock paths in your php.ini file - just in case someone else comes across this issue.

 
Magento Community Magento Community
Magento Community
Magento Community
 
chiefair
Mentor
 
Avatar
Total Posts:  1839
Joined:  2009-06-04
 

Further explanation of the above.

Magento is asking PHP to go find MySQL’s socket file to use it for communication with the database.

It will be defined in the my.cnf file and the problem may be that the Apache DSO version of PHP cannot find it.

Search your php.ini file specific for the PHP DSO module:

; Default socket name for local MySQL connects.  If empty, uses the built-in
MySQL defaults.
http://php.net/pdo_mysql.default-socket
pdo_mysql.default_socket=

Note the blank line, php cannot find the seat of its pants with both hands and a flashlight. Go find my.cnf

[mysqld]
basedir
=/opt/bitnami/mysql
datadir
=/opt/bitnami/mysql/data
port
=3306
socket
=/opt/bitnami/mysql/tmp/mysql.sock
tmpdir
=/opt/bitnami/mysql/tmp
bind
-address=127.0.0.1

Change the pdo_mysql.default_socket line in php.ini as follows:

pdo_mysql.default_socket=/opt/bitnami/mysql/tmp/mysql.sock

And then restart Apache so it reloads the php.ini file. It should now have the flashlight and motor skills necessary…

Another cause may be that the directory for the mysql.sock may be missing or have wrong permissions set. Typically, mysqld runs as user mysqld. After looking at your my.cnf file in the [mysqld] section at the socket= entry, check to make sure the path to the file location exists.

socket=/var/mysql/mysql.sock

Go to /var and look for a directory named mysql owned by mysql.root, create it if it’s missing. Mysql will then proceed to create mysql.sock with the proper permissions

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top