Local Community

Wp db reset -- Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

Bug Summary

When I try to run wp db reset in a terminal (using Open Site Shell) I get the error

Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

but wp db import and wp db export work as expected.

Steps to reproduce

Open the site shell and run wp db reset

Environment Info

Describe your environment.

  • What Operating System are you using?
    Mac OS 10.15.7
  • What versions of site software (Nginx, Apache, PHP, MySQL) is used?
    nginx: 1.16.0
    php: 7.4.1
  • What version of Local is installed?
    6.1.2+5473

Supporting info

I’ve also tried placing the following in a wp-cli.yml in the /public directory for my site as I found suggested somewhere…

db reset: socket: /Users/reggieofarrell/Library/Application Support/Local/run/0aiZUbn5Q/mysql/mysqld.sock

…but that didn’t seem to change anything

Trying to add the --socket flat on the command line while running the command like so…

wp db reset --socket=" /Users/reggieofarrell/Library/Application Support/Local/run/0aiZUbn5Q/mysql/mysqld.sock"

results in…

Error: Parameter errors:
unknown --socket parameter

Please provide your Local Log. See this Community Forum post for instructions on how to do so:

Include any screenshots or video recordings of the issue to help others reproduce.


Nobody huh?

1 Like

Same issue. I am on MacOS Monterey.

1 Like

Same issue here. I looked through all old threads. Some claim you can define “–socket” option but that did not work for me.

Just like you said, I can run import/export… why doesn’t reset work?! Somebody help.