- MySQL官網(wǎng)下載MySQL Community并安裝
- 打開終端夷狰,輸入
vi ~/.zshrc
- 敲下回車,輸入
export PATH=${PATH}:/usr/local/mysql/bin/
:wq
source ~/.zshrc
- 重新啟動(dòng)終端精堕,輸入mysql -u root -p和密碼后即可登陸MySQL
參考:https://stackoverflow.com/questions/35858052/zsh-command-not-found-mysql