On Mac OS when we installed MySQL successfully and tried to access it from command line we got into this issue.
can't access mysql from command line
The MySQL was installed successfully but it was not included in the $PATH variable. When we tried to print that $PATH variable MySQL was not printed.
We had to add MySQL bin path to the $PATH variable like below in the .bash_profile file.