Creaticalmind

mysql with homebrew 본문

Database/MySQL

mysql with homebrew

TigerBJ 2018. 2. 24. 19:55

homebrew를 이용해서 mysql 설치를 해보도록 하자


1. 당연히 homebrew는 설치가 되어 있어야 한다.


homebrew설치 >>> https://brew.sh/index_ko.html

터미널 열고, 따라가면 된다. 


2. mysql 설치


$ brew update


- 설치명령어

$ brew install mysql


- 서버 시작 명령어

$ mysql.server start


- 간편보안 설정 명령어

$ mysql_secure_installation


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: 


보안상 강력한 비밀번호를 써야 하는 사람은 Yes, 그외에 분들은 No 

저는 No 했습니다. 

혹시 비밀번호 잘 까먹으면 그냥 No하세요. 그리고 1234 이런거 쓰시면 됩니다.

우리 비번때문엔 스트레스 받지 맙시다 !!!!


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) : 


익명 계정을 삭제 하는가? 에 대한 질문입니다.

나름의 보안문제(?) 때문에 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) : 


root 계정에 대한 원격 접속을 허용할것인가? 에 대한 질문입니다.

localhost가 아닌 IP에서 root접속을 허용하지 않을것인가? 라고 물어보길래 

저는 편의상 아니요 라고 대답 했습니다.

개발때문에 외부에서도 접속을 해야 하는 경우가 있을꺼 같아서 외부 접속을 허용 하였습니다.

혹시 나도 허용해야지 라고 생각해서 Yes하시면 안됩니다.

외부 접속을 허용하지 않을꺼니? 라고 물어본거기 때문에 '아니~~~~!!!!!!!!!!!!' 허용 할꺼야 라고 대답을 하셔야 합니다.


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) : 


기본적으로 설치가 되는 test 디비에는 누구나 들어 올수 있습니다.

보안문제 때문에 test디비를 지울수 있습니다.

저는 보안문제는 아니지만, Yes 함.

다들 이렇게 하더라고요 ㅎㅎ


Reloading the privilege tables will ensure that all changes

made so far will take effect immediately.


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


무조건 Yes해주셔야 합니다. 안그러면, 선택한 내용이 디비에 반영이 안됩니다.


3. 이제 접속해보시죠


$ mysql -u root -p


Enter password: 


패스워드를 물어봅니다.


방금전에 위에서 설정하신 여러분만의 비밀번호를 입력해주세요.


Your MySQL connection id is 19

Server version: 5.7.21 Homebrew


Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.


Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.


Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.


mysql> 


잘 접속이 되는 것을 확인 하실수 있습니다.


다음 기록때 또 만나요 ! 안녕 !!


logout

Saving session...

...copying shared history...

...saving history...truncating history files...

...completed.


[프로세스 완료됨]


Comments