Contents
homebrew로 Mariadb 설치
   Aug 8, 2022     2 min read

1. MariaDB(또는 Mysql) 설치 및 테스트

글쓴이는 Homebrew 3.5.8 버젼을 사용하고 있다.

MariaDB설치 : brew install mariadb
  • 경로 /opt/homebrew/Cellar/mariadb/
mysql 설치 : brew install mysql
  • /opt/homebrew/Cellar/mysql/

기존에 mysqld이 있었다. 그런데 mariadb 다운 받으려고 homebrew를 했는데…. 💥 충돌

※주의 : mysql이 있는 상태에서 Mariadb 를 brew 로 install할 경우 충돌이 일어난다.

> brew install mysqld

Conflicts with:
mariadb (because mysql, mariadb, and percona install the same binaries)
percona-server (because mysql, mariadb, and percona install the same binaries)
/opt/homebrew/Cellar/mysql/8.0.29 (311 files, 295MB) *
Poured from bottle on 2022-07-09 at 01:30:48

원인

  1. 둘다 port 3306 을 사용 중이다. 둘 중 하나 port번호를 바꾼다. → 포트 충돌 💥

    mariadb → port :3306

    mysql → port : 3307

포트번호 바꿨다.

homebrew로 설치해서 my.cnf 파일을 찾기가 너무 힘들었다.

나의 m1맥북에는 etc/opt/homebrew/etc 에 있었다.

my.cnf 으로 port = 3307로 설정했다.

Untitled

Untitled 1

하지만

Error: Cannot install mariadb because conflicting formulae are installed. mysql: because mariadb, mysql, and percona install the same binaries

Please brew unlink mysql before continuing.

Unlinking removes a formula’s symlinks from /opt/homebrew. You can link the formula again after the install finishes. You can –force this install, but the build may fail or cause obscure side effects in the resulting software.

이런 에러가 뜨면서 설치가 안됐다.

저기서 알려준 방법으로 brew unlink mysql 이라고 하고 다시 brew install mariadb 라고 하니깐 된다. !!!🎉🎉 성공 … 감동 😭 

설치 끝.. 링크

설치 후

연결 하기 전 brew services list 로 서비스 중인 db를 확인한다.

Untitled 2

mariadb를 활성화 시켜준다.

Untitled 3

Untitled 4

  1. 도커 또는 가상머신을 이용해서 사용한다? 이건 무리데쓰네.. 😫
DBVersion
mysqlmysql Ver 8.0.29 for macos12.2 on arm64 (Homebrew)
mariadb다운받는다는 가정하에 버젼 10.5

아직 도커를 안해봐서 도전하기가 어렵다. 우선 위에 있는 방법들로 해보자 ! 안된다면 도커를 배우자 !