- 이전 눈물겹게 macbook을 한번 밀었다. 그래서 MariaDB를 재설치 해야하는 상황에 error가 났는데 참으로 힘겨웠다.
ERROR 2002 (HY000): Can't connect to local server through socket '/tmp/mysql.sock' (2)
- 설치 후
sudo mariadb-secure-installation
를 하려할 때 이 에러가 났다. 원인은 server를 시작해주지 않아 생긴 일이었다. 평소 server를 자동으로 열게 설정해 놨기에 이 에러를 뵐 일이 없었다. brew services start mariadb
로 서버를 시작하자 다음 에러가 났다.
mariadb bootstrap failed: 5: input/output error try re-running the command as root for richer errors. error: failure while executing; /bin/launchctl bootstrap gui/501 /users/(이름검열)/library/launchagents/homebrew.mxcl.mariadb.plist exited with 5.
- 이 에러에 찾아보니 my.cnf라는 mysql의 설정파일을 다시 설정해주거나 제거 후 다시 재설치하라고 한다.
- my.cnf의 위치:
mysql --verbose --help | grep my.cnf
- mysql 관련 파일 제거
rm -rf /usr/local/etc/my.cnf
rm -rf /usr/local/var/mysql
or
rm -rf /opt/homebrew/etc/my.cnf
rm -rf /opt/homebrew/var/mysql
- MariaDB 재설치
brew reinstall mariadb
- MariaDB 재시작
brew services restart mariadb
- 이후에도 같은 에러가 나오면
brew services stop mariadb brew services start mariadb
- 이후에도 같은 에러가 또 나오면
만병통치약재부팅
그랬더니 해결
여러 mysql 프로세스가 잡혀있어서 그런 듯하다.
참고
- 해결하기 위해 많은 문서를 봤지만 결정적으로 이 글을 보고 힌트를 많이 얻었다...
글쓴이 분…감사합니다..
https://light-tree.tistory.com/245 - https://stackoverflow.com/questions/69159310/mac-big-sur-mariadb-will-not-run
- 다른 참고할 만한 글
mysql.server start로 여러 번 하다가 프로세스가 늘어나 생기는 부분에 대해 나와있다.
https://okky.kr/article/615253
'DB > MariaDB' 카테고리의 다른 글
[MariaDB] 15. foreign key (0) | 2022.12.20 |
---|---|
[MariaDB] 14.primary key (0) | 2022.12.20 |
[MariaDB] 13.auto_increment (0) | 2022.12.20 |
[MariaDB] 12.union (0) | 2022.12.20 |
[MariaDB] 11. join (0) | 2022.12.20 |
댓글