guagay_wk
guagay_wk

Reputation: 28030

Certain string in Windows PATH causing error

I am adding this string C:\Program Files (x86)\MySQL\MySQL Fabric 1.5 & MySQL Utilities 1.5\ to my windows 10 environmental variable PATH. This caused problem to the PATH. I believe the root cause is the character & in the string. How can I add the string successfully to the windows PATH?

Upvotes: 4

Views: 1194

Answers (2)

cwahls
cwahls

Reputation: 753

Try escaping the ampersand (&) with a carrot (^).

C:\Program Files (x86)\MySQL\MySQL Fabric 1.5 ^& MySQL Utilities 1.5

Upvotes: 5

user3748764
user3748764

Reputation: 346

I had the same problem as you on windows 7 after installing MySQL 5.7.11.

The issue is that the MySQL installer adds two paths containing & to the PATH system variable without surrounding them by quotation marks.

This may cause all sorts of trouble to other BATCH files. For instance a simple:

echo %PATH% 

from the command line would actually execute the mysql client because MySQL appears after the & which Windows sees as way to combine separate commands. This caused other scripts like Python virtual environment activate to misbehave on my machine.

Surrounding the two MySQL paths in the PATH environment system variable permanently fixes the issue. So it looks like a bug in MySQL installer.

Upvotes: 2

Related Questions