M1 맥북에 homebrew 이용하여 mysql 설치하기

Dr.Green·2022년 1월 20일
0

준비사항:

brew 설치 미설치시 아래 명령 실행해 주면 됩니다
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

설치 진행

검색

$ brew update
$ brew search mysql
// mysqql 버전 입력이 없을 경우 최신 버전이 설치 됩니다.


설치

$ brew install mysql 
$ brew services start mysql
또는 아래로 시작가능
$ mysql.server start

보안설정

$ mysql_secure_installation
new password:
re-enter new password:
1. 아무나 유저를 저거하여 비밀번호 입력해야 로그인 되도록 변경.
Remove anonymous users? (Press y|Y for Yes. any other key for No)
2. 테스트 데이터베이스 제거할지 묻는 옵션.
Remove test database and access to it? (Press y|Y for Yes, any other key for No)
3.변경된 권한을 적용할지 묻는 옵션.
Reload privilege tables now? (Press y|Y for Yes, any other key for No)
4.원격지에서 root로 접근 허용할지 옵션. 보통 No
Disallow root login remotely? (Press y|Y for Yes, any other key for No)

접속

$ mysql -u root -p
$ password: your password
mysql> show databases;
mysql
test
gallery
...
mysql> use gallery

기본명령어는 다음 블로그에서 작성할게요

profile
모바일 퍼스트

0개의 댓글