Support » Developing with WordPress » WP CLI Can’t connect to local MySQL server through socket

  • Resolved pablo07

    (@pablo07)


    Why is the mysql socket path not downloaded from php.ini?

    $ wp db reset
    error: ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2)
    
    wp-config.php
    define('DB_HOST', 'localhost');
    
    php.ini:
    mysqli.default_socket: /var/run/mysql/mysql.sock
    
    /etc/my.cnf
    socket                         = /var/run/mysql/mysql.sock

    works only if I type “–socket=/var/run/mysql/mysql.sock”

    can I add to the global configuration of WP CLI socket?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘WP CLI Can’t connect to local MySQL server through socket’ is closed to new replies.