install MySQL for mac

mac m1 pro에 MySQL 설치하기

Author

Don Don

Published

June 28, 2022

homebrew 설치

homebrew 홈페이지 : https://brew.sh/

terminal 창에 아래 코드를 입력하면 homebrew가 설치된다. homebrew 홈페이지에 있는 코드와 동일하다.

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

설치가 완료된 후에는 terminal 창을 끄지말고, Next step 문구에 있는 코드를 복사해서 넣어줘야 한다.

Next step 하단에 echo 'eval $(블라블라) eval $(/opt/homebrew/bin/brew shellenv)'를 복사해서 terminal에 붙여넣기를 해준다.

mysql 설치

  1. mysql 설치 : brew install mysql

  2. 설치 버전 확인 : mysql -V

  3. 서버 켜기 : mysql.server start

  4. 초기 설정 : mysql_secure_installation (재설정하고 싶을 때도 동일하게 입력)

    • 복잡한 비밀번호 설정 : Yes or No

    • 익명 유저 설정 여부 : Yes or No

    • localhost에서만 root 접속 여부 : Yes or No

    • test 데이터베이스 삭제 여부 : Yes or No

  5. mysql 접속 : mysql -u root -p

  6. sql 종료 : exit

  7. 서버 종료 : mysql.server stop

workbench 설치

  1. brew install --cask mysqlworkbench

  2. mysqlworkbench 실행

  3. workbench 세팅 방법 참고 : https://dearmycode.tistory.com/15

    • mysql.server start 하고 연결해야 잘 작동함

Citation

BibTeX citation:
@online{don2022,
  author = {Don, Don and Don, Don},
  title = {Install {MySQL} for Mac},
  date = {2022-06-28},
  url = {https://dondonkim.netlify.app/posts/2021-06-28-install-sql-for-mac/sql.html},
  langid = {en}
}
For attribution, please cite this work as:
Don, Don, and Don Don. 2022. “Install MySQL for Mac.” June 28, 2022. https://dondonkim.netlify.app/posts/2021-06-28-install-sql-for-mac/sql.html.