Wp db check not working

VERSION: Local 5.2.3+2248

I get a socket failure when I use the wp db commands.

For example, following ‘Open Site Shell’:

  • wp user list works perfectly
  • wp db check fails with:

mysqlcheck: Got error: 2002: Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2) when trying to connect

Specifying the socket as defined in the shell config works:
wp db check --socket=$HOME/Library/Application\ Support/Local/run/HLRhEyzsF/mysql/mysqld.sock

1 Like

Hi Local

This is is still an issue (running 5.2.5 on macOS).

Looks like the php.ini settings are not being used, or the exported values are not quite correct.

A somewhat hacky workaround is:

ln -s $HOME/Library/Application\ Support/Local/run/HLRhEyzsF/mysql/mysqld.sock /tmp/mysql.sock

Which will probably work for all instances (not just ‘HLRhEyzsF’).

This is still an issue. Using Local 5.4.1+3311 which I downloaded and installed fresh today. Trying to connect to the database using Sequel Pro also fails. (This worked flawlessly in 3.x, which I’ve been using until now.) The suggestion by pragmatictom doesn’t work for me.

Still an issue with the wp cli commands in terminal console on Mac.

This still seems to be an issue?

A little reply from someone at Local would be lovely.

Hey @pragmatictom – I’m having issues replicating this on my end, with Local 5.7.4 on macOS Catalina 10.15.5.

  • What OS version is installed, and what version of Local are you using?
  • If you’ve installed a new version of Local, have you tried exporting the site and re-importing it into a new one to see if that refreshes things?
  • Another thing to consider is if there’s some sort of PATH pollution going on. Do you have mysql installed on your host machine? Are there any custom configurations you have in place for mysql?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.