本文根据我的实际经历写的,参考链接
http://stackoverflow.com/questions/33467337/reset-mysql-root-password-using-alter-user-statement-after-install-on-mac
http://stackoverflow.com/questions/10577374/mysql-command-not-found-in-os-x-10-7
Mac在安装mysql时会自动生成一个密码,但在第一次建立连接时却提示
You must reset your password using ALTER USER statement before executing this statement.
这种情况下并不能直接在workbench中执行alter user语句。需要在命令行下。