[mysql] MacOS에서 mysql 설치하기

Tim·2022년 1월 16일
0

MySQL

목록 보기
1/2
post-thumbnail

1. MacOS에서 mysql 설치하기!

mysql을 설치하는 방법은 여러가지가 있지만
MacOS에는 Homebrew라는 아주 좋은 맥전용 패키지가 있기때문에 Homebrew를 이용해 설치하겠습니다.

mysql을 설치하기 전에 먼저 Homebrew를 업데이트 해줍니다.
(brew를 사용하기 전에는 반드시 업데이트를 해주어야 합니다.)

> brew update

mysql 설치

> brew install mysql

mysql 서버 실행

> mysql.server start


(해당 창이 안 뜬다면 무시하셔도 괜찮습니다.)

mysql 설정

> mysql_secure_installation
1. "Would you like to setup VALIDATE PASSWORD component? Press y|Y for Yes, any other key for No"
비밀번호 가이드 설정에 대한 질문입니다.
Yes : 복잡한 비밀번호 설정
No : 쉬운 비밀번호 설정
"Yes"

2. "Remove anonymous users? (Press y|Y for Yes. any other key for No)"
사용자 설정을 묻는 질문입니다.
Yes : 접속하는 경우 "mysql -u root"처럼 -u 옵션 필요
No : 접속하는 경우 "mysql"처럼 -u 옵션 불필요
"Yes"

3. "Disallow root login remotely? (Press y|Y for Yes, any other key for No)"
다른 IP에서 root 아이디로 원격접속을 설정하는 질문입니다.
Yes : 원격접속 불가능
No : 원격접속 가능
"Yes"

4. "Remove test database and access to it? (Press y|Y for Yes, any other key for No)"
Test 데이터베이스를 설정하는 질문입니다.
Yes : Test 데이터베이스 제거
No : Test 데이터베이스 유지
"Yes"

5. "Reload privilege tables now? (Press y|Y for Yes, any other key for No)"
변경된 권한을 테이블에 적용하는 설정에 대한 질문입니다.<br>
Yes : 적용시킨다.
No : 적용시키지 않는다.
"Yes"

6. All Done!

mysql 로그인

> mysql -u root -p


패스워드를 입력하고 정상적으로 로그인이 되면 쉘이 "mysql>"로 변경된 걸 확인할 수 있습니다.
"mysql>" 쉘에서 로그아웃 명령어는 "exit" 또는 "quit"입니다.

mysql 서버 종료

> mysql.server stop

2. MacOS에서 workbench 설치하기!

> brew install --cask mysqlworkbench
profile
HTML5, CSS3, JavaScript, Typescript, React 프론트엔드 개발자입니다.

0개의 댓글