mac: mysql忘记root密码, 报错ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

这一段:
> $ brew services stop mysql
> $ pkill mysqld
> $ rm -rf /usr/local/var/mysql/ **# NOTE: this will delete your existing database!!!**
> $ brew postinstall mysql
> $ brew services restart mysql
> $ mysql -u root
原文:https://www.cnblogs.com/Tokubara/p/15242299.html