Mac Mysql 설치 & dbeaver 연동(M1)

남경민·2023년 3월 28일
0

Mysql 설치(Homebrew 사용)

  1. Homebrew 설치
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
  1. Mysql 설치
$ brew install mysql
$ brew services start mysql
$ mysql_secure_installation
  1. Mysql 시작
$ mysql -h localhost -u root -p
Enter password: [비밀번호 입력]
mysql>

권한 에러 발생시

//에러
Error: The following directories are not writable by your user:
/usr/local/share/info
You should change the ownership of these directories to your user.
  sudo chown -R $(whoami) /usr/local/share/info
And make sure that your user has write permission.
  chmod u+w /usr/local/share/info

-> 해결방법(이것도 안댕,,)

//뒤의 /usr/local/share/info는 저장경로 다르기 때문에 which info, which mysql로 경로 확인하기
$ sudo chown -R $(whoami) /usr/local/share/info
$ chmod u+w /usr/local/share/info

비밀번호 에러 발생 시

//이것은 비밀번호 틀렸다는 것
Your connection attempt failed for user 'root' to the MySQL server at 127.0.0.1:3306:
Access denied for user 'root'@'localhost' (using password: YES)
//이것은 비밀번호가 없을 때 에러
Your connection attempt failed for user 'root' to the MySQL server at 127.0.0.1:3306:
Access denied for user 'root'@'localhost' (using password: NO)

→ 해결방법(나는 다 안됨,,)

//비밀번호 설정안되어 있으면 그냥 엔터
$ mysql -u root -p
$ALTER user 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '바꿀 비밀번호';

권한 에러 다 설정해도 안되면, mysql 지우고 brew 다시 깔기!! ⇒ 이렇게 해서 성공!

  • dbeaver 연동

    1. dbeaver 설치

    2. 맨 위쪽 플러그모양 눌러서 Mysql 선택

  • use db명 할시, No Active connection에러
    → 위의 N/A 되있었는거 localhost로 변경!

profile
백엔드 개발을 좋아하고 공부하고 있습니다. 코드 작성 뿐만 아니라 쿼리 성능 고려, 클린 코드, 테스트 케이스 작성에 주력해 모든 에러 상황을 대비하는 개발자로 성장하고 싶습니다.

0개의 댓글