DevLog ๐Ÿ˜ถ

[MariaDB] Homebrew - MariaDB ์„ค์น˜ ์‹œ ์˜ค๋ฅ˜ ๋ฐœ์ƒํ–ˆ์„ ๋•Œ (Can't connect to local server through socket '/tmp/mysql.sock') ๋ณธ๋ฌธ

๊ฐœ๋ฐœ์ผ์ง€

[MariaDB] Homebrew - MariaDB ์„ค์น˜ ์‹œ ์˜ค๋ฅ˜ ๋ฐœ์ƒํ–ˆ์„ ๋•Œ (Can't connect to local server through socket '/tmp/mysql.sock')

dolmeng2 2022. 10. 22. 02:59

 

 

- ํ•œ์ฐฝ ๋งฅ๋ถ์— ํ”„๋กœ๊ทธ๋žจ ์„ค์น˜ํ•˜๋‹ค๊ฐ€ ๋ฐœ์ƒํ–ˆ๋˜ ๋ฌธ์ œ์˜€๋Š”๋ฐ, ํ•œ ๋ฒˆ์ฏค์€ ์ •๋ฆฌํ•˜๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์•„์„œ ์ •๋ฆฌํ•ด๋‘๋Š” ๊ธ€.

- ๋‹น์‹œ ์ƒํ™ฉ์„ ์บก์ณํ•ด๋‘์ง€ ์•Š์•„์„œ ์Šคํฌ๋ฆฐ์ƒท์€ ์—†์ง€๋งŒ, ๋ฐœ์ƒํ–ˆ๋˜ ๋ฌธ์ œ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค.

mariadb Can't connect to local server through socket '/tmp/mysql.sock' (2)

 

[์ „๋ฐ˜์ ์ธ ์ƒํ™ฉ]

- 1์ฐจ์ ์œผ๋กœ mysql์„ ์„ค์น˜ํ•œ ๋’ค, mariadb๋ฅผ ์„ค์น˜ํ•˜๊ณ  ์‹ถ์—ˆ๋˜ ์ƒํ™ฉ

- mysql ์‚ญ์ œ > mariadb ์„ค์น˜ > ๋ฌด์–ธ๊ฐ€ ์˜ค๋ฅ˜ ๋ฐœ์ƒ > ์žฌ์„ค์น˜ ํ•ด์•ผ์ง€~ > ์žฌ์„ค์น˜ ํ–ˆ๋”๋‹ˆ ์˜ค๋ฅ˜์ƒ๊น€ > ???

 

- ๋‹น์‹œ์— ๊ตฌ๊ธ€๋ง์„ ์—„์ฒญ ํ•ด๋ดค์—ˆ๋Š”๋ฐ ์•ˆ ๋‚˜์™€์„œ ์ ˆ๋งํ•˜๋‹ค๊ฐ€... ๊ฒจ์šฐ ํ•ด๊ฒฐํ–ˆ๋‹ค.

- brew uninstall mariadb

: ๋จผ์ €, mariadb๋ฅผ ์‚ญ์ œํ•œ๋‹ค. (mysql๋„ ๊น”๋ ค์žˆ๋‹ค๋ฉด ๋ฌด์กฐ๊ฑด ์‚ญ์ œ)

 

- rm -rf /usr/local/var/mysql

- rm /usr/local/etc/my.cnf

- sudo rm -rf /usr/local/bin/mysql*

- sudo rm -rf /usr/local/Cellar/mysql

- sudo rm -rf /usr/local/var/mysql

: mysql ๊ด€๋ จ๋œ ์„ค์น˜ ํŒŒ์ผ์€ ์ „๋ถ€ ์ œ๊ฑฐํ•œ๋‹ค๋Š” ์ƒ๊ฐ์œผ๋กœ ๋‹ค ์‚ญ์ œํ•ด์ค€๋‹ค.

 

- brew install mariadb

: mariadb ์žฌ์„ค์น˜๋ฅผ ์ง„ํ–‰ํ•ด์ค€๋‹ค.

 

- sudo chown {user_name} /usr/local/var

: ์ด ๋ถ€๋ถ„์ด ์ œ์ผ ์ค‘์š”!

: user_name์€ ์‚ฌ์šฉ์ž์˜ ์ด๋ฆ„ ๋„ฃ์–ด์ฃผ๋ฉด ๋˜๊ณ , ์—ฌ๊ธฐ์„œ ํ•ด๋‹น ํด๋”์— ๋Œ€ํ•ด์„œ ๊ถŒํ•œ์„ ์ค˜์•ผ ๋œ๋‹ค...

 

- ์ด๋ ‡๊ฒŒ ํ•˜๊ณ  ๋‚˜์„œ ์‹คํ–‰ํ•˜๋‹ˆ๊นŒ ๋‹คํ–‰ํžˆ๋„ ์ž˜ ์‹คํ–‰์ด ๋˜์—ˆ๋˜ ๊ธฐ์–ต์ด ๋‚œ๋‹ค. ๋‹ค์‹œ๋Š”... mysql + mariadb ๋™์‹œ์— ๊ฑด๋“ค์ง€ ์•Š์„ ์˜ˆ์ •์ด๋‹ค.

Comments