MySQL 설치

Jung-Kwon Lee·2023년 7월 8일
0

DB

목록 보기
1/3

Homebrew를 통해 Mysql을 설치하고자 한다.

설치:
아래의 명령어를 통해 mysql을 설치할 수 있다.

brew install mysql

버전 확인:
아래의 명령어를 통해 설치된 mysql의 버전을 확인할 수 있다.

mysql --version

MySQL 실행하기

mysql.server start

MySQL 종료하기

mysql.server stop

MySQL 데몬으로 실행하기

brew services start mysql

재시작하기

brew services restart mysql

데몬으로 실행된 MySQL 종료

brew services stop mysql

MySQL 기본 설정

mysql_secure_installation

위 명령어 입력 시 나오는 질문들

1) VALIDATE PASSWORD COMPONENT. (복잡한 비밀번호 설정 여부)
2) set the password for root here. (root 계정 패스워드 설정)
3) Remove anonymous users? (익명 사용자 삭제 여부)
4) Disallow root login remotely? (원격 접속 허용하지 않을 것인지)
5) Remove test database and access to it? (test DB 삭제 여부)
6) Reload privilege tables now? (변경된 권한을 반영하여 다시 로드할 것인지)

MySQL 접속

mysql -u root -p

MySQL의 상태 확인하기

status

Reference :
Homebrew로 MySQL 설치/실행/종료하기 / M1 맥북 초간단 MySQL 설치법 - https://bsscl.tistory.com/5

0개의 댓글