I installed mysql with homebrew.
mysql --version
mysql Ver 8.0.11 for osx10.13 on x86_64 (Homebrew)
and
which mysql
/usr/local/bin/mysql
but when I try to use it after a pipe, I get the following error
unzip -p dump.sql.zip | mysql
zsh: command not found: mysql
Why is that and how can I fix it?
Best Answer
You have an extra character before
mysql
that looks like a space, but is not a space. You have to fix that before running the command. This problem occurs when you press the space bar while you are holding the Option key.Another example:
Another option is to eliminate the space after the pipe entirely:
Option+Space = \xc2\xa0 (UTF-8)
Space = Regular Space