Check mysqld status by brew services
and stop it.
- brew services ls
- brew services stop mysql
Chckc mysqld status by lsof
and stop it.
- lsof -iTCP:3306
- mysql.server stop
Reset root password by mysqld_safe
- mysqld_safe --skip-grant-tables
- switch to new terminal
- mysql -u root
- mysql> FLUSH PRIVILEGES;
- mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass';
- mysql> \q
- mysql.server start
- mysql.server stop
- brew services start mysql
- mysql -u root -p