Issue with "mysqlcheck: No such file or directory"

Issue Summary

I am trying yo run wp db optimize from within the site shell for my Local WP installation. That generates an error message that says, env: mysqlcheck: No such file or directory.

Troubleshooting Questions

  • This happens for all Local sites, including new ones and old ones. All other mysql commands run fine.

  • I can create new site, access the site, but still have the same error occur.

  • I am running MySQL 8.0.16.


To replicate the issue, open a site shell for the WP instance running within Local and run the command wp db optimize or wp db repair, which would invoke mysqlcheck.

System Details

  • Which version of Local is being used?

  • What Operating System (OS) and OS version is being used?

    • macOS Catalina 10.15.7
  • local-lightning.log (346.4 KB) local-lightning.log (346.4 KB)

1 Like

I’m having the same exact issue. I can’t even find a way to define mysqlcheck as an environment variable anywhere.

Thanks for letting us know - I’ve created a bug report so our devs can take a closer look at fixing it!

It looks like mysqlcheck is missing from MySQL 8, but if you use MySQL 5.7 it should work.

I know that this isn’t ideal, but you should be able to re-import the site and select the 5.7 version of MySQL on the “Custom” tab of the Environment screen. Once that’s been imported of the site and then run those various wpcli commands:

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