최대한 MySql을 삭제하지 않고 권한을 고치거나 하는 방향으로 시도해봤지만, 잘되지 않아 깔끔하게 MySql를 삭제하고 다시 설치했다.
아래의 단계를 그대로 따라하면 간단하게 해결된다.
현재 서비스 중인 mysql 서비스를 중지한다.
$ brew services stop mysql
mysql 지우기
$ brew uninstall mysql
관련 폴더와 파일들 지우기
$ rm -rf /usr/local/var/mysql
$ rm /usr/local/etc/my.cnf
출처: https://walkingfox.tistory.com/89 [걸어가는 여우]
homebrew를 이용한 설치
$ brew install mysql
$ brew info mysql
mysql service 시작
$ brew services start mysql
MySql 접속
$ mysql -u root -p
MySql 비밀번호 변경
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'yourPassword';