Skip to content

mysql.sock error on local development machine #88

Closed
@mikebranderhorst

Description

@mikebranderhorst

I had a socket error using dev/shell/log.php (not using front- and backend)
After some research I found out there are more developers with this problem.
Solution for me was app/etc/local.xml host from localhost to 127.0.0.1

<host><![CDATA[127.0.0.1]]></host>

Or leaving it empty:

<host><![CDATA[]]></host>

Or by adding unix socket:

<unix_socket><![CDATA[/path/to/mysql.sock]]></unix_socket>

I think the last two are not preferred because of: version control, deploy, production etc.

But the first method should at least be mentioned.

<host><![CDATA[localhost]]></host><!-- use 127.0.0.1 when having error 2002 on connecting db -->

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions