Mac安装mysql后无法使用命令行zsh: command not found: mysql
liangyuji@liangyujideMacBook-Pro ~ % mysql
zsh: command not found: mysql
原因:没有配置环境变量
1. 在/etc/profile配置环境变量
再下面新增配置路径(测试发现临时有效)
export PATH=$PATH:/usr/local/mysql/bin
添加路径
liangyuji@liangyujideMacBook-Pro ~ % sudo vim /etc/profile
Password:
liangyuji@liangyujideMacBook-Pro ~ % mysql
zsh: command not found: mysql
liangyuji@liangyujideMacBook-Pro ~ %