안녕세계

[MySQL] MacOS에서 MySQL 설치 (with. homebrew) 본문

[MySQL] MacOS에서 MySQL 설치 (with. homebrew)

Junhong Kim 2018. 3. 29. 12:23
728x90
반응형

Mac에서 MySQL 설치

homebrew 를 통한 MySQL 설치 과정을 알아 보겠습니다.
brew 명령어를 사용하기 위해서는 터미널에 아래 명령어로 homebrew 를 설치해야 합니다.

$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

homebrew 설치후 brew 명령어를 통해 MySQL을 설치하세요.

$ brew install mysql

MySQL 실행

MySQL 설치 완료후 실행하세요.

$ mysql.server start

MySQL 설정

명령어를 실행하면 6가지 사항에 대해 설정을 지정해야합니다.
아래 사항은 설정 사항에 대한 예시입니다.

$ mysql_secure_installation

(1) 비밀번호 복잡도 검사 과정 ➠ No

복잡한 비밀번호 설정을 위한 과정을 진행하지 않습니다.

Securing the MySQL server deployment.
Connecting to MySQL using a blank password.
VALIDATE PASSWORD PLUGIN can be used to test passwords and improve security.
It checks the strength of password and allows the users to set only those passwords which are secure enough.
Would you like to setup VALIDATE PASSWORD plugin?
Press y|Y for Yes, any other key for No:

(2) root 비밀번호 설정

비밀번호와 비밀번호 확인을 입력하세요.

Please set the password for root here.
New password: Re-enter new password:

(3) 익명 사용자 삭제 여부 ➠ Yes

익명 사용자를 삭제합니다.

By default, a MySQL installation has an anonymous user, allowing anyone to log into MySQL without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment.
Remove anonymous users? (Press y|Y for Yes, any other key for No) :

(4) 원격 접속 허용 ➠ Yes

로컬에서만 개발할 것이므로 Yes를 입력합니다.

Normally, root should only be allowed to connect from 'localhost'.
This ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? (Press y|Y for Yes, any other key for No) :

(5) test 데이터 베이스 삭제 여부 ➠ No

test 데이터 베이스는 남겨두도록 합니다.

By default, MySQL comes with a database named 'test' that anyone can access.
This is also intended only for testing, and should be removed before moving into a production environment.
Remove test database and access to it? (Press y|Y for Yes, any other key for No) :

(6) 위에서 설정한 사항 수정 유/무 ➠ No

수정할 사항이 있다면 Yes를 하고 다시 설정 과정을 진행하세요.

Reload privilege tables now? (Press y|Y for Yes, any other key for No) :

모든 설정을 완료하면 다음 과 같은 메시지가 출력되면서 종료됩니다.

All done!

MySQL 사용

아래 명령어를 입력한 뒤 root 계정의 비밀번호를 입력하고 사용할 수 있습니다.

$ mysql -u root -p

 

728x90
반응형
Comments