If the MySQL Workbench app is unexpectedly quitting on a Mac computer, installing a slightly older version of MySQL Workbench 8.0.* could help with this issue check the Teaching Assistant's first highlighted answer in this Q&A thread for details about it.
mysql
command not found error in the macOS zsh terminal after downloading and installing MySQLNewer versions of macOS are now using the zsh terminal instead of the bash terminal by default. You can use this command to check which terminal your macOS is running:
echo $SHELL
* If you see bash in the output of that command, you can immediately skip to the 'ORIGINAL LECTURE NOTE: Mac Installation Commands' section below.
But, if you see zsh in the output of that command, then editing the ~/.bash_profile
file, like seen in the instructions, won't work instead, you need to edit your ~/.zshrc
file while following the Mac installation instructions. Or, instead of manually opening and editing the mentioned terminal configuration file, you can just run this as a single terminal command and it should add the necessary configuration to the ~/.zshrc file to make the mysql
command work in your zsh terminal:
echo "export PATH=${PATH}:/usr/local/mysql/bin" >> ~/.zshrc
After that, completely exit your terminal app, then start a brand new terminal window, and try the mysql
command again!
After you have downloaded and installed MySQL on your Mac, you'll likely need to run the following commands to be able to execute the mysql
program from the command line.
NOTE: Instead of manually opening and editing the mentioned ~/.bash_profile
terminal configuration file in the upcoming instructions, you can just run this as a single terminal command and it should add the necessary configuration to the ~/.bash_profile file to make the mysql
command work in your bash terminal:
echo "export PATH=${PATH}:/usr/local/mysql/bin" >> ~/.bash_profile
After that, completely exit your terminal app, then start a brand new terminal window, and try the mysql
command again!
Open up a new window in Terminal
Run this command: open ~/.bash_profile
If the previous step gave you an error, run this first touch ~/.bash_profile
You should see a file called .bash_profile open up in a text editor. Inside that file, paste the following line at the bottom: export PATH=${PATH}:/usr/local/mysql/bin
Save the file and close it
Open up a NEW TERMINAL WINDOW (or run this command: source ~/.bash_profile
in the existing terminal window) and you should now be able to run mysql -u root -p
Enter your root password when prompted
If you have questions or issues with any of this, please reach out in the course Q&A boards so we can help out further!