i’m under macOS Catalina ( 10.15.3 ) and i can’t use “wp db reset” but “wp db search test” work…
So i removed all data of Local ( in “Application support/Local” and “Application” ) and re-install everything. Now i got a fresh install of Local 5.2.4.
I create a new site, open site shell and having the same issue.
JiveDig@JiveDigs-MBP ~ % /Users/JiveDig/Library/Application\ Support/Local/ssh-entry/8xa0al5vx.sh; exit
-n -e
Setting Local environment variables...
----
WP-CLI: WP-CLI 2.4.0
PHP: 7.3.5
MySQL: mysql Ver 14.14 Distrib 5.7.28, for macos10.14 (x86_64) using EditLine wrapper
----
Launching shell: /bin/zsh ...
JiveDig@JiveDigs-MBP public % wp db export
mysqldump: Got error: 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) when trying to connect
Running Local 5.2.5, but it happened on the prior version of v5 as well.
Although SOCKET=$(mysqld --verbose --help | grep ^socket | awk '{print $2, $3, $4}');ln -sv $SOCKET /tmp/mysql.sock echos the socket correctly and saves as a variable but the wp db export doesn’t work as it should out of the box nor with --socket="${SOCKET}"
However, if I manually insert --socket then this works:
wp db export wp-content/plugins/my-plugin/tests/_data/dump.sql --socket="/Users/cliff/Library/Application Support/Local/run/oQ5Apb3x2/mysql/mysqld.sock"
So, thankfully, this workaround exists, but this should definitely be fixed