설치전

brew가 설치 되어있어야 합니다.
[HomeBrew사용법]
(https://velog.io/@noyo0123/HomeBrew-%EC%82%AC%EC%9A%A9%EB%B2%95)

mysql 설치

터미널을 켜시고 다음 명령어를 입력합니다.

brew update

brew install mysql

brew services start mysql

설치후 익명상태로 mysql 명령을 사용하여 쓸 수 있지만, 보안에 취약합니다.

mysql이 실행중이라면 터미널을 켜고 다음 명령어를 입력합니다.

mysql_secure_installation

Securing the MySQL server deployment.

Enter password for user root:
The 'validate_password' component is installed on the server.
The subsequent steps will run with the existing configuration
of the component.
Using existing password for root.

Estimated strength of the password: 50
Change the password for root ? ((Press y|Y for Yes, any other key for No) : y

New password:

Re-enter new password:

Estimated strength of the password: 50
Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y
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) : y
Success.


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) : y
Success.

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) : y
 - Dropping test database...
Success.

 - Removing privileges on test database...
Success.

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) : y
Success.

일단은 다 'Y'를 입력해줍니다. 자세한건 읽어보시면 됩니다.
레퍼런스에 자세히 나와있습니다.
레퍼런스 : OS X에서 MySQL을 잘못 설치했을 때 다시 설치하는 방법 - appkr

일단은 빠르게 설치합니다.

mysql 접속

터미널을 켜서
mysql -u root -p 명령어를 입력합니다.
위에 root비밀번호를 입력한 비밀번호로 접속할 수 있습니다.

mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 20
Server version: 8.0.18 Homebrew

Copyright (c) 2000, 2019, 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>