# 添加mysql的path $ sudo mate ~/.bash_profile export PATH=/usr/local/mysql/bin:$PATH # 保存配置 :wq $ source ~/.bash_profile # 修改mysql密码 $ mysqladmin -u root password # 登录mysql $ mysql -u root -p # 启动/停止开机启动中的mysql服务 $ sudo /Library/StartupItems/MySQL/MySQL start/stop