今日のお悩み
ずいぶん昔にインストールしたMySQLにパスワード設定したっぽいけど、忘れてアクセスできない
$ brew info mysql
mysql: stable 5.7.16 (bottled)
解決
> MySQLプロセス終了
sudo mysql.server stop
> mysqld_safeで起動
$ /usr/local/bin/mysqld_safe --skip-grant-tables
2017-01-03T07:07:28.6NZ mysqld_safe Logging to '/usr/local/var/mysql/bohelabo.local.err'.
2017-01-03T07:07:28.6NZ mysqld_safe Starting mysqld daemon with databases from /usr/local/var/mysql
> rootパスワードの更新
update mysql.user set authentication_string=password("new_pass") where user='root';
> MySQLプロセス開始
sudo mysql.server start
>新しいパスワードで接続
mysql -u root -pnew_pass