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

这个gist

这一段:

> $ 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