Home > Archive > MySQL > ๐Ÿ‹[MySQL] MySQL Server Start/Stop

๐Ÿ‹[MySQL] MySQL Server Start/Stop
MySQL

MySQL Server Start/Stop

์ดˆ๊ธฐ ์„ธํŒ…
์ฒ˜์Œ MySQL์„ ์„ค์น˜์‹œ MySQL ์›น ์‚ฌ์ดํŠธ์— ์ ‘์†ํ•˜์—ฌ DMG File์„ ๋ฐ›์•„์„œ ์„ค์น˜ํ•˜๋Š” ๋ฐฉ๋ฒ•๊ณผ Homebrew๋ฅผ ํ™œ์šฉํ•˜์—ฌ ์„ค์น˜ํ•˜๋Š” ๋ฐฉ๋ฒ• ๋‘ ๊ฐ€์ง€๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค.

  • ์ €๋Š” MySQL์„ Homebrew๋ฅผ ์ด์šฉํ•ด์„œ ์„ค์น˜ํ•˜์ง€ ์•Š๊ณ  MySQL ์›น ์‚ฌ์ดํŠธ์— ์ ‘์†ํ•˜์—ฌ DMG File์„ ๋ฐ›์•„ ์„ค์น˜ํ•˜์˜€์Šต๋‹ˆ๋‹ค.
    • (์š”๊ฒƒ์ด ์•ฝ๊ฐ„์˜ ํŒจ์ฐฉ?๐Ÿ˜ตโ€๐Ÿ’ซ)

์ •์ƒ ์„ค์น˜ ์ดํ›„์— mysql.server start ๋ช…๋ น์–ด๋ฅผ terminal์— ์ž…๋ ฅํ•˜๋ฉด ์•„๋ž˜ ๊ทธ๋ฆผ๊ณผ ๊ฐ™์€ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค.

  • homebrew๋กœ ์„ค์น˜ํ–ˆ๋‹ค๋ฉด .zshrc ํŒŒ์ผ์— ์•„๋งˆ PATH ํ™˜๊ฒฝ๋ณ€์ˆ˜๊ฐ€ ์ž˜ ์ถ”๊ฐ€๊ฐ€ ๋˜์–ด ์ด๋Ÿฐ ์—๋Ÿฌ๊ฐ€ ๋‚˜์ง€ ์•Š์•˜์„ ๊ฒƒ์ž…๋‹ˆ๋‹ค.
    • ๋งŒ์•ฝ ์ด๋Ÿฐ ์—๋Ÿฌ๊ฐ€ ๊ทธ๋ž˜๋„ ๋ฐœ์ƒํ–ˆ๋‹ค๋ฉด ๊ฐ„๋‹จํ•˜๊ฒŒ PATH ํ™˜๊ฒฝ๋ณ€์ˆ˜๋ฅผ .zshrc ํŒŒ์ผ ๋‚ด๋ถ€์— export PATH=$PATH:/usr/local/mysql/bin ์ด๋Ÿฐ์‹์œผ๋กœ ๋„ฃ์–ด ์ค€ ๋’ค ํ„ฐ๋ฏธ๋„์„ ์žฌ์‹œ์ž‘ํ•ด์ฃผ๋ฉด ๋ฉ๋‹ˆ๋‹ค.

์ €๋Š” homebrew๋กœ ์„ค์น˜ํ•˜์ง€ ์•Š์•˜์œผ๋ฏ€๋กœ ์ € ๋ช…๋ น์–ด๊ฐ€ ์ผ๋‹จ์€ ์•ˆ๋˜๋Š”๊ฒŒ ์ •์ƒ์ด์—ฌ์„œ homebrew๋กœ ์„ค์น˜ํ•˜์ง€ ์•Š์•˜์„ ๊ฒฝ์šฐ ์–ด๋–ป๊ฒŒ ์„œ๋ฒ„๋ฅผ ๋™์ž‘์‹œํ‚ค๋Š”์ง€ ์•Œ์•„๋ดค์Šต๋‹ˆ๋‹ค.

  • ๋จผ์ € /usr/local/mysql/data/ ๋กœ ์ด๋™ํ•ฉ๋‹ˆ๋‹ค.
  • sudo ๋ช…๋ น์–ด๋ฅผ ํ™œ์šฉํ•˜์—ฌ sudo /usr/local/mysql/support-files/mysql.server start ๋ช…๋ น์–ด๋ฅผ ์ž…๋ ฅํ•ด์ค๋‹ˆ๋‹ค.

์ด์™€ ๊ฐ™์ด ๊ฐ„๋‹จํ•˜๊ฒŒ ์„œ๋ฒ„๋ฅผ ๋™์ž‘ ์‹œํ‚ฌ ์ˆ˜ ์žˆ์—ˆ์Šต๋‹ˆ๋‹ค.

๋ฐ˜๋Œ€๋กœ ์„œ๋ฒ„๋ฅผ ๋‹ซ์„ ๋• sudo /usr/local/mysql/support-files/mysql.server stop๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ๋ฉ๋‹ˆ๋‹ค.


์ฐธ๊ณ  ๋ฌธ์„œ