As I was downloading the mySQL shell (version 5.7.17), it occurred to me that I couldn’t access mysql through the terminal as directed by many many tutorials online.
I’m not sure if it’s because the tutorials are outdated or I’ve been looking at the wrong stackoverflow posts but a few things were different for my download of the mySQL shell 5.7.17:
- the shell is actually called mysqlsh, not mysql
- the file was installed in/usr/local/mysql-5.7.17-macos10.12-x86_64/bin, rather than just /usr/local/bin
To solve the problem:
echo $PATH export PATH=$PATH:/usr/local/mysql-5.7.17-macos10.12-x86_64/bin mysqlsh
If I look in my $PATH, I did not have the location of my mySQL shell in my $PATH so the second line adds the correct path to the shell.
The last line initiates the mySQL shell.