Getting a "Command cex was not found" error trying to execute "drush cex"

I've installed Drush for my Drupal website on Windows 10 and I'm trying to export the config settings using drush cex in Git Bash.

However, when doing this I get the following error:

Command cex was not found. Drush was unable to query the database. As a result, many commands are unavailable. Re-run your command with --debug to see relevant log messages.

I feel like the problem might be in the fact that my user folder is called Tom Lastname and thus has a space in it. This at least results in error messages for cd and other commands.

which drush yields the right folder so it is correctly installed. However, there is no drush.php there. Only drush and drush.bat.

The complete error message I get using drush cex --debug is shown in the following screenshot:

Screenshot of error message for drush cex --debug

1 Answer

The command drush cex seems to need to use mysql.  Did you notice the error

 'mysql' is not recognized as an internal or external command, operable program or batch file.

about 40% of the way down your screenshot?  You need to add msyql to your search path — see drush-ops/drush · Issue #3464 on GitHub.

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like