๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
์นดํ…Œ๊ณ ๋ฆฌ ์—†์Œ

mac os mysql5.7 ์‹คํ–‰ ๋ฌธ์ œ ํ•ด๊ฒฐ - Error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) ์—๋Ÿฌ ํ•ด๊ฒฐ

by ๐Ÿงž‍โ™‚๏ธ 2023. 6. 29.
๋ฐ˜์‘ํ˜•
Error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

 

๋Œ€๋ถ€๋ถ„์˜ ํ•ด๋‹น ์—๋Ÿฌ์— ๋Œ€ํ•œ ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•์€ ์•„๋ž˜์˜ค ๊ฐ™์€ mysql ์„œ๋น„์Šค ์‹คํ–‰ ์—ฌ๋ถ€์˜€๋‹ค.

brew services start mysql@5.7

 

ํ•˜์ง€๋งŒ ๋‚ด ๊ฒฝ์šฐ๋Š” ์•„๋‹ˆ์—ˆ๋‹ค!!

๋‚ด ๊ฒฝ์šฐ์—๋Š” ๊ธฐ์กด mysql 8.0์„ค์น˜๋ฅผ ํ•œ ํ›„ ํ•จ๊ป˜ ์ œ๊ฑฐํ–ˆ๋‹ค ๊น”์•˜๋Š”๋ฐ, configํŒŒ์ผ์— ๋ฌธ์ œ๊ฐ€ ์ƒ๊ฒผ๋˜ ๊ฒƒ์ด์—ˆ๋‹ค.

brew install mysql@5.7

์—์„œ ์ž์„ธํžˆ ์‚ดํŽด๋ณด๋‹ˆ ์•„๋ž˜์˜ ๋ฌธ์ œ๊ฐ€ ์ƒ๊ฒผ์—ˆ๋‹ค.

[ERROR] unknown variable 'mysqlx-bind-address=127.0.0.1'
[ERROR] Aborting

 

์ด ๊ฒฝ์šฐ ์•„๋ž˜์˜ ๋ช…๋ น์ด ์ฃผ์š”ํ–ˆ๋‹ค!

ํ™ˆ ๊ฒฝ๋กœ์— ๋‹ค์Œ์˜ ํŒŒ์ผ์„ ๋งŒ๋“ค์–ด ์ค€๋‹ค. 

vi ~/.my.cnf

ํŒŒ์ผ ์•ˆ์—๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์ž…๋ ฅํ•ด์ค€๋‹ค.

# Default Homebrew MySQL server config
[mysqld]
# Only allow connections from localhost
bind-address = 127.0.0.1

 

* ์ฐธ๊ณ ๋กœ brew uninstall ์ดํ›„์— ์ฐ์ฐํ•˜๋ฉด ์•„๋ž˜ ๋ถ€๋ถ„๋„ ๋‚ ๋ ค์ฃผ์ž.

rm -rf /opt/homebrew/var/mysql

 

ํ•ด๊ฒฐ๋๋‹ค๋ฉด, ๋งจ ์œ„์—์ฒ˜๋Ÿผ ์„œ๋น„์Šค๋ฅผ ์‹œ์ž‘ํ•˜๊ฑฐ๋‚˜ ์•„๋ž˜์™€ ๊ฐ™์ด ์žฌ์‹œ์ž‘ํ•ด์ฃผ์ž!

brew services restart mysql@5.7

 

 

์ฐธ๊ณ ์ž๋ฃŒ

https://gentlesark.tistory.com/156

 

Mac OS Monterey(๋ฒ„์ „ 12.6)์—์„œ mysql 5.7 ์„ค์น˜ํ•˜๊ธฐ

์‚ฌ์šฉํ•˜๊ณ  ์žˆ๋Š” ๋งฅ ๋ฒ„์ „ mysql ์„ค์น˜๋ฅผ ์œ„ํ•ด Homebrew๋ฅผ ํ™œ์šฉํ•˜์˜€์œผ๋ฉฐ, ์ด์™€ ๊ด€๋ จํ•ด์„œ๋Š” ์•„๋ž˜ ๊ธ€ ์ฐธ์กฐ. https://gentlesark.tistory.com/114 [Mac] ๋งฅ์— Homebrew ์„ค์น˜ ๋ฐ brew cask ์„ค์น˜ Ubuntu์— ํŒจํ‚ค์ง€ ๊ด€๋ฆฌ ๋„๊ตฌ apt๊ฐ€

gentlesark.tistory.com

 

๋ฐ˜์‘ํ˜•

๋Œ“๊ธ€