One of my clients insists on using WAMP for hosting Drupal 7. I've always been using Ubuntu for development, but now I have to work with WAMP. I do much Drush administration with sql-dump and modifying Drupal from the command line. I tried Drush on windows, but it is PITA to use.

What are some ways to use Drush as close as possible to the Linux versions? For some reasons, some Drush commands don't properly work on Windows. I usually use drush sql-dump > backup.sql, but in Windows there is no equivalent to that.

  • I am using xampp (which I don't think that does make any huge difference in relation to wamp) on windows 7 and drush sql-dump > backup.sql works very well (Drush version 5.8). Actually I don't think that drush is lacking to anything when is used on windows. You don't even need Cygwin to install it and make it run. I'll post a detailed answer later if I have the time. – mchar Aug 17 '16 at 14:59
  • That doesn't work. I get the following error: C:\sites\tmsample>drush sql-dump > adsf.sql mysqldump: Couldn't execute 'SET OPTION SQL_QUOTE_SHOW_CREATE=1': You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'OPTION SQL_QUOTE_SHOW_CREATE=1' at line 1 (1064) Database dump failed [error] – Patoshi パトシ Aug 17 '16 at 15:10
  • Check this post, seems to be the case. Your MySQL version does not support the SET OPTION SQL_QUOTE_SHOW_CREATE=1;, read this for more details. – mchar Aug 17 '16 at 15:48

There are four possibilities:

  1. Using Git Bash for Drush. Off the top of my head, this won't work for SQL commands, though
  2. If you're using Windows 10, you may want to install the anniversary edition update. It gives a Linux bash shell. It also has its limits (no kernel modules), but those limits shouldn't impede Drush use
  3. CYGWIN. It may take some fiddling, but may do the trick too
  4. Try and persuade your client to use Vagrant, then run Ubuntu in there
| improve this answer | |
  • 5. You can also install it via composer (for windows) and than set it into global enviroment. 6. Installing Acquia Dev Desktop also contains a working drush and a maybe working composer. – golddragon007 Sep 7 '18 at 7:09

I will recommend on doing it only with the new WSL possibility as it is the most native environment for drush on windows supported by Microsoft itself (basically it's a native Ubuntu environment including all Ubuntu binaries, inside Windows, created in collaboration with Canonical).

I have asked and answered 2 questions about how to install Drush on Windows 10 with WSL.

You might need further packages and envar conf before it can run smoothly and act upon WAMP installation from outside (from the Linux subsystem).

Oh and here is an on-the-way advice: Try to upgrade Windows itself if you need a better build-release and DON'T install Windows insider preview-builds (it's annoying to quit afterwards).

| improve this answer | |

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.