ํ‹ฐ์Šคํ† ๋ฆฌ ๋ทฐ

๋ฐ˜์‘ํ˜•

โœ… [Macbook M1] mariadb ์„ค์น˜, ์‚ญ์ œ

์„ค์น˜

https://mariadb.com/ko/resources/blog/installing-mariadb-10-1-16-on-mac-os-x-with-homebrew/

 

Installing MariaDB Server on Mac OS X with Homebrew | MariaDB

Developing on your Mac? Get the latest stable MariaDB version on OS X easily with Homebrew. See this step by step guide on installing MariaDB 10.4.13.

mariadb.com

์‚ญ์ œ

brew uninstall mariadb
# mariadb ๊นจ๋—ํ•˜๊ฒŒ ์ง€์šฐ๊ธฐ

# mariadb ์„œ๋น„์Šค ์ค‘์ง€
brew services stop mysql
or
brew services stop mariadb

# mariadb ์‚ญ์ œ
brew unlink mysql
brew remove mysql
brew uninstall mysql
brew cleanup
or
brew unlink mariadb
brew remove mariadb
brew uninstall mariadb
brew cleanup

sudo rm -rf /usr/local/var/mysql
sudo rm -rf /usr/local/bin/mysql*
sudo rm -rf /usr/local/Cellar/mysql --/mariadb
sudo rm -rf /usr/local/var/homebrew/{mac-user}/mariadb
sudo rm -rf /usr/local/etc/my.cnf --์„ค์ •ํŒŒ์ผ
sudo rm -rf /usr/local/etc/my.cnf.d --์„ค์ •ํŒŒ์ผ

์˜ค๋ฅ˜์‹œ

#๋‚˜์˜ ๊ฒฝ์šฐ port์˜ ํ”„๋กœ์„ธ์Šค๋ฅผ killํ•ด์ฃผ๋‹ˆ ์ •์ƒ ๋™์ž‘ํ•˜์˜€์Šต๋‹ˆ๋‹ค.
#PID์ฐพ์•„์„œ
lsof -i :"3306"
#ํ•ด๋‹น PID ์ฃฝ์ด๊ธฐ
kill -9 PID

MariaDB ์‹คํ–‰

#์„ค์น˜ํ™•์ธ
brew services list

#MariaDB ์‹คํ–‰
brew services start mariadb

#MariaDB ์ค‘๋‹จ
brew services stop mariadb

๊ณ„์ •์ƒ์„ฑ ๋ฐ ๊ถŒํ•œ์ฃผ๊ธฐ

# mariadb ์ ‘์†
mariadb -u root -p

# ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ํ™•์ธ
show databases;

# ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ์—†์„ ๊ฒฝ์šฐ ์ƒ์„ฑํ•˜๊ธฐ
CREATE DATABASE local_db;

# mysql database๋ฅผ ์‚ฌ์šฉ
use mysql;

# ์‚ฌ์šฉ์ž ํ™•์ธ
select host, user, password from user;

# ์‚ฌ์šฉ์ž ๊ณ„์ • ์ƒ์„ฑ {('์•„์ด๋””'@'%') : ์–ด๋Š๊ณณ์ด๋“  ์ ‘์†๊ฐ€๋Šฅ, ('์•„์ด๋””'@'localhost') : ๋กœ์ปฌ์—์„œ๋งŒ ์ ‘์†๊ฐ€๋Šฅ}
CREATE USER '์•„์ด๋””'@'%' IDENTIFIED BY '๋น„๋ฐ€๋ฒˆํ˜ธ';

# ์‚ฌ์šฉ์ž ๊ถŒํ•œ ์ฃผ๊ธฐ
GRANT ALL PRIVILEGES ON ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค.* TO '์•„์ด๋””'@'%';

# RELOAD (ํ™˜๊ฒฝ ์„ค์ •์ด ๋ณ€๊ฒฝ์ด ๋  ๊ฒฝ์šฐ mariadb ์žฌ์‹œ์ž‘์—†์ด ๋ณ€๊ฒฝํ•œ ์„ค์ • ๋ถ€๋ถ„์„ ์ ์šฉ์‹œํ‚ฌ๋•Œ ์‚ฌ์šฉ)
FLUSH PRIVILEGES;
๊ณต์ง€์‚ฌํ•ญ
์ตœ๊ทผ์— ์˜ฌ๋ผ์˜จ ๊ธ€
์ตœ๊ทผ์— ๋‹ฌ๋ฆฐ ๋Œ“๊ธ€
Total
Today
Yesterday
๋งํฌ
ยซ   2024/12   ยป
์ผ ์›” ํ™” ์ˆ˜ ๋ชฉ ๊ธˆ ํ† 
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 31
๊ธ€ ๋ณด๊ด€ํ•จ
๋ถ„๋ฅ˜ ์ „์ฒด๋ณด๊ธฐ (80)
๐Ÿ“บ Develop (0)
๐ŸŒ‹ Error Fixed (5)
๐Ÿ— Tool (5)
๐Ÿ’ป MacBook M1 (15)
๐Ÿ“ฆ ETC (1)

์ด ํฌ์ŠคํŒ…์€ ์ฟ ํŒก ํŒŒํŠธ๋„ˆ์Šค ํ™œ๋™์˜ ์ผํ™˜์œผ๋กœ, ์ด์— ๋”ฐ๋ฅธ ์ผ์ •์•ก์˜ ์ˆ˜์ˆ˜๋ฃŒ๋ฅผ ์ œ๊ณต๋ฐ›์Šต๋‹ˆ๋‹ค.