티스토리 뷰

카테고리 없음

m1 /tmp/mysql.sock

rediate.will 2021. 11. 8. 13:15
[client]
socket = /opt/homebrew/var/mysql/mysql.sock
[mysqld]
socket = /opt/homebrew/var/mysql/mysql.sock

 

를 my.cnf에 추가. (/opt/homebrew/etc/my.cnf)

 

했는데도 비슷한 패턴으로 오류가 난다!!!!! 

 

아마 서버를 켜려고 하거나 brew services restart mysql하면 리스타팅 되는것처럼 보일지도 모른다.

 

그러나 이런 문제가 계속 반복이 되면 

 

설치했을때 내가 거지같이 설치하진 않았는지 점검 해봐야한당.

 

삭제하고 다시 설치했다.

➜  etc git:(stable) brew install mysql
==> Downloading https://ghcr.io/v2/homebrew/core/mysql/manifests/8.0.27_1
Already downloaded: /Users/candleworks/Library/Caches/Homebrew/downloads/769f2b5da8a5c2f5339bf3a888c003ed624cd885fed9d6afd8d56318e3b59932--mysql-8.0.27_1.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/mysql/blobs/sha256:2c2a1ac2cfa3
Already downloaded: /Users/candleworks/Library/Caches/Homebrew/downloads/ef809095146f6650f121a4027e9db9ade15b4a4f0ddf5159c92fe5ddaee23341--mysql--8.0.27_1.arm64_monterey.bottle.tar.gz
==> Pouring mysql--8.0.27_1.arm64_monterey.bottle.tar.gz
==> /opt/homebrew/Cellar/mysql/8.0.27_1/bin/mysqld --initialize-insecure --user=
Last 15 lines from /Users/candleworks/Library/Logs/Homebrew/mysql/post_install.01.mysqld:
2021-12-24 18:15:24 +0900


/opt/homebrew/Cellar/mysql/8.0.27_1/bin/mysqld
--initialize-insecure
--user=candleworks
--basedir=/opt/homebrew/Cellar/mysql/8.0.27_1
--datadir=/opt/homebrew/var/mysql
--tmpdir=/tmp


2021-12-24T09:15:24.233608Z 0 [System] [MY-013169] [Server] /opt/homebrew/Cellar/mysql/8.0.27_1/bin/mysqld (mysqld 8.0.27) initializing of server in progress as process 8575
2021-12-24T09:15:24.234335Z 0 [ERROR] [MY-010457] [Server] --initialize specified but the data directory has files in it. Aborting.
2021-12-24T09:15:24.234348Z 0 [ERROR] [MY-013236] [Server] The designated data directory /opt/homebrew/var/mysql/ is unusable. You can remove all files that the server added to it.
2021-12-24T09:15:24.234385Z 0 [ERROR] [MY-010119] [Server] Aborting
2021-12-24T09:15:24.234618Z 0 [System] [MY-010910] [Server] /opt/homebrew/Cellar/mysql/8.0.27_1/bin/mysqld: Shutdown complete (mysqld 8.0.27)  Homebrew.
Warning: The post-install step did not complete successfully
You can try again using:
  brew postinstall mysql
==> Caveats
We've installed your MySQL database without a root password. To secure it run:
    mysql_secure_installation


MySQL is configured to only allow connections from localhost by default


To connect run:
    mysql -uroot


To restart mysql after an upgrade:
  brew services restart mysql
Or, if you don't want/need a background service you can just run:
  /opt/homebrew/opt/mysql/bin/mysqld_safe --datadir=/opt/homebrew/var/mysql
==> Summary
🍺  /opt/homebrew/Cellar/mysql/8.0.27_1: 304 files, 294MB
==> Running `brew cleanup mysql`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
➜  etc git:(stable) brew postinstall mysql
==> Postinstalling mysql
==> /opt/homebrew/Cellar/mysql/8.0.27_1/bin/mysqld --initialize-insecure --user=
Last 15 lines from /Users/candleworks/Library/Logs/Homebrew/mysql/post_install.01.mysqld:
2021-12-24 18:15:32 +0900


/opt/homebrew/Cellar/mysql/8.0.27_1/bin/mysqld
--initialize-insecure
--user=candleworks
--basedir=/opt/homebrew/Cellar/mysql/8.0.27_1
--datadir=/opt/homebrew/var/mysql
--tmpdir=/tmp


2021-12-24T09:15:32.350378Z 0 [System] [MY-013169] [Server] /opt/homebrew/Cellar/mysql/8.0.27_1/bin/mysqld (mysqld 8.0.27) initializing of server in progress as process 8947
2021-12-24T09:15:32.351105Z 0 [ERROR] [MY-010457] [Server] --initialize specified but the data directory has files in it. Aborting.
2021-12-24T09:15:32.351108Z 0 [ERROR] [MY-013236] [Server] The designated data directory /opt/homebrew/var/mysql/ is unusable. You can remove all files that the server added to it.
2021-12-24T09:15:32.351151Z 0 [ERROR] [MY-010119] [Server] Aborting
2021-12-24T09:15:32.351206Z 0 [System] [MY-010910] [Server] /opt/homebrew/Cellar/mysql/8.0.27_1/bin/mysqld: Shutdown complete (mysqld 8.0.27)  Homebrew.
Warning: The post-install step did not complete successfully
You can try again using:
  brew postinstall mysql

 

이렇게 로그가 떴는데, 중요부분은 

워닝났다고 postinstall을 하라는 내용이었고, 했더니 오류가 나는 내용이다.

 

그래서 찾아봤더니 인텔 기준으로 /usr/local/var/mysql 을 삭제하고 다시 실행하라는 내용이었고,

 

내 맥은 m1이라서 /opt/homebrew/var/mysql 을 삭제했다.

  / rm -r /opt/homebrew/var/mysql 


  / brew postinstall mysql
==> Postinstalling mysql
==> /opt/homebrew/Cellar/mysql/8.0.27_1/bin/mysqld --initialize-insecure --user=
  / mysql -uroot
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.27 Homebrew


Copyright (c) 2000, 2021, Oracle and/or its affiliates.


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> 

 

잘 들어가진다.....

 

 

 

 

이거땜에 크리스마스 이브에... 하!

공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2025/06   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30
글 보관함