WordPress localhost OSX installation: Error establishing a database connection

I have a problem with WordPress config on my localhost nginx.

On wp-admin configuration i receive Error establishing a database connection.

Read More

When I create wp-config manually, in mysql logs I have only Aborted connection 12 to db: 'unconnected' user: 'dimmi' host: 'localhost' (Got an error reading communication packets)

This is my debug log:

Warning: mysqli_real_connect(): (HY000/2002): No such file or directory in /Users/patryk/Public/dimmi/dimmi_wordpress2/wp-includes/wp-db.php on line 1488

Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /Users/patryk/Public/dimmi/dimmi_wordpress2/wp-includes/wp-db.php on line 1518

Warning: mysql_connect(): No such file or directory in /Users/patryk/Public/dimmi/dimmi_wordpress2/wp-includes/wp-db.php on line 1518`

Command line login and simple PHP script work perfectly, file permissions are 777.

I have OSX El Captain, mysql installed using homebrew. I ran out of ideas :/

Related posts

1 comment

  1. The problem is in connection between php and mysql.pls check following;

    1.Check user name , password is correct
    2.check the user ‘dimmi’ have permission for host ‘localhost’
    3.is mysql running ? (since you can login from terminal,mysql is running )
    4.try to telnet localhost 3306
    (this will return
    “Connected to localhost.
    Escape character is ‘^]’ ” if mysql is running on your machine in 3306)

Comments are closed.