1. 서버중지
mysql.server stop
# brew 이용 할 경우
brew services stop mysql
2. 서버 재시작
mysql.server start --skip-grant-tables
# brew
brew services start mysql
3. 로그인
mysql -u root
4. 안 될 경우 재설치 (차라리 이게 더 빠를 수도..)
brew services list # mysql 서비스 중인 지 확인
which mysql # mysql 설치 경로 확인
rm -rf mysql경로
brew uninstall mysql # mysql 제거
brew list | grep mysql # mysql 삭제 됐는 지 체크
brew install mysql # mysql 재설치
brew services stop mysql
mysql.server start --skip-grant-tables
mysql -u root (재설치했기에 비밀번호가 없어서 로그인 됨)
5. root 비밀번호 초기화
update mysql.user set authentication_string='하고싶은 비밀번호' where user='root'; # root 계정 비밀번호 설정
flush privileges; # 권한 설정 저장
6. 재부팅 후 다시 접속 하면 됨.