๐Ÿš€ Languege/Basic SQL

[MySQL 8.0] MySQL ์œ ์ € ์›๊ฒฉ์ ‘์† ํ—ˆ์šฉํ•˜๊ธฐ

mini_world 2021. 3. 16. 19:52
๋ชฉ์ฐจ ์ ‘๊ธฐ

 

์•ˆ๋…•ํ•˜์„ธ์š” ๐Ÿ™‹ ๐Ÿ™‹‍โ™€๏ธ 

MySQL์„ ์ฒ˜์Œ ์„ค์น˜ํ•˜๊ณ , ์™ธ๋ถ€์—์„œ ์ ‘์†ํ•ด๋ณด๋ ค๊ณ  ํ•˜๋ฉด ์ด๋Ÿฐ ์—๋Ÿฌ๊ฐ€ ๋‚˜์˜ต๋‹ˆ๋‹ค.

mysql -h <mysql์•„์ดํ”ผ> -u root -p

ERROR 1130 (HY000): Host '14.52.234.161' is not allowed to connect to this MySQL server

MySQL์€ ๊ธฐ๋ณธ์ ์œผ๋กœ ๋กœ์ปฌ(Localhost)์—์„œ๋งŒ ์ ‘์†์ด ํ—ˆ์šฉ๋ฉ๋‹ˆ๋‹ค. 
MySQL ์‚ฌ์šฉ์ž๋ฅผ ์‚ดํŽด๋ณผ๊นŒ์š”?

mysql> SELECT Host,User,plugin,authentication_string FROM mysql.user;

์œ ์ €๊ฐ€ ๋‹ค "localhost"๋กœ ํ‘œ์‹œ๋˜์–ด์žˆ์Šต๋‹ˆ๋‹ค. ์ด ๊ฒฝ์šฐ, ์™ธ๋ถ€์—์„œ๋ถ€ํ„ฐ์˜ ์ ‘์†์ด ๋ถˆ๊ฐ€๋Šฅ ํ•ฉ๋‹ˆ๋‹ค.
๊ทธ๋ž˜์„œ ์ด๋ฒˆ ์‹œ๊ฐ„์—์„œ๋Š” ์™ธ๋ถ€์—์„œ ์ ‘์†ํ•  ์ˆ˜ ์žˆ๋„๋ก ๊ณ„์ •์„ ์„ค์ •ํ•ด๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค. :)

* ์ฃผ์˜ * ์ด๋ฒˆ ํฌ์ŠคํŒ…์—์„œ๋Š” Root๊ณ„์ •์„ ๋ณ€๊ฒฝํ•˜์ง€๋งŒ, ๋ณด์•ˆ ์ƒ Root๊ณ„์ • ์™ธ ๋ณ„๋„์˜ ๊ณ„์ •์„ ๋งŒ๋“ค์–ด ์‚ฌ์šฉํ•˜๊ธฐ๋ฅผ ๊ถŒ์žฅํ•ฉ๋‹ˆ๋‹ค.

 

๋จผ์ €, ์‚ฌ์šฉ์ž๋ฅผ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค :)

mysql> CREATE USER 'root'@'%' identified by 'Xptmxm1212!@';

 

์ด์ œ ๊ถŒํ•œ์„ ํ• ๋‹นํ•ฉ๋‹ˆ๋‹ค.

mysql> GRANT ALL PRIVILEGES ON *.* to 'root'@'%';

 

์ƒˆ๋กœ๊ณ ์นจ ํ•ฉ๋‹ˆ๋‹ค!

mysql> flush privileges;

 

๋ฒŒ์จ ์™„๋ฃŒ ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.
์œ ์ €๊ฐ€ ์ •์ƒ์ ์œผ๋กœ ์ƒ์„ฑ๋˜์—ˆ๋Š”์ง€ ํ™•์ธํ•ด์ค๋‹ˆ๋‹ค. ๐Ÿ˜Š๐Ÿ‘๐Ÿป

mysql> SELECT Host,User,plugin,authentication_string FROM mysql.user;

 

์ด์ œ ์™ธ๋ถ€์—์„œ ์ ‘์†์ด ์ž˜ ๋˜๋Š”์ง€ ํ™•์ธํ•ด๋ด…์‹œ๋‹ค!! 

์ด์ œ ์™ธ๋ถ€์—์„œ๋„ ์ ‘์†์ด ์ž˜ ๋˜๋„ค์š”!! :)


์ฐธ๊ณ  : zetawiki.com/wiki/MySQL_%EC%9B%90%EA%B2%A9_%EC%A0%91%EC%86%8D_%ED%97%88%EC%9A%A9

 

MySQL ์›๊ฒฉ ์ ‘์† ํ—ˆ์šฉ - ์ œํƒ€์œ„ํ‚ค

๋‹ค์Œ ๋ฌธ์ž์—ด ํฌํ•จ...

zetawiki.com

 

728x90