将路径添加到zsh
文件中
~ vim ~/.zshrc
export PATH=$PATH:/usr/local/mysql/bin
注意
- MySQL on OS X doesn’t like the value “localhost”. Instead, use 127.0.0.1
- port of 3306.
密码一直不对的解决方法:
进入mysql的bin目录
cd /usr/local/mysql/bin
sudo su
之后会出现
sh-3.2#
然后输入
./mysqld_safe --skip-grant-tables &
重新打开一个终端
mysql -u -root
mysql> FLUSH PRIVILEGES;
mysql> SET PASSWORD FOR root@'localhost' = PASSWORD('lyp');
FLUSH PRIVILEGES;