After I run a wp-cli command such as wp db export database.sql, it says ‘grep’ is not recognized as internal or external command. Warning: Failed to get current character set of the posts table. Reason: ERROR 2002 (HY000): Can’t connect to MySQL server on ‘localhost’ (10061)
mysqldump: Got error: 2002: “Can’t connect to MySQL server on ‘localhost’ (10061)” when trying to connect
What steps can be taken to replicate the issue? Feel free to include screenshots, videos, etc
open site shell and run wp-cli command
System Details
Local Version:
Version 9.0.1+6673
Operating System (OS) and OS version:
Windows 10 64-bit
Local Logs
not allowed to paste (too many chars) and can’t see button to attach.
Security Reminder
Local does a pretty good job of scrubbing private info from the logs and the errors it produces, however there’s always the possibility that something private can come through. Because these are public forums, always review the screenshots you are sharing to make sure there isn’t private info like passwords being displayed.
Thanks, but it did not help. Before the database error, it spits a grep error
C:\Users\Rafa Carvalhido\Local Sites\forja-dos-mestres\app\public>wp db export teste.sql
'grep' is not recognized as internal or external command , an operable program or a batch file.
Warning: Failed to get current character set of the posts table. Reason: ERROR 2002 (HY000): Can't connect to MySQL server on 'localhost' (10061)
mysqldump: Got error: 2002: "Can't connect to MySQL server on 'localhost' (10061)" when trying to connect
For the wp-config.php update, are you using the port number from your site’s database tab (and not the 10061 reported in your message)? When I use the correct port number I’m able to export fine on Windows (the grep message alone should not prevent the export).
Also important to check that the site is running, otherwise you’ll see the same connection error.