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

๋ฐ˜์‘ํ˜•

์™ธ๋ถ€์—์„œ DB์„œ๋ฒ„ ์ ‘์†์‹œ ์ ‘๊ทผ์„ ๊ฑฐ๋ถ€ ๋‹นํ•˜๋Š” ๊ฒฝ์šฐ๊ฐ€ ์žˆ๋‹ค.

 

์ด๋Š” ํ•ด๋‹น ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค์—์„œ ์ ‘์† ๊ณ„์ •์— ๋Œ€ํ•œ ๊ถŒํ•œ์„ ์„ค์ •ํ•ด์ฃผ์ง€ ์•Š์•„์„œ ์ƒ๊ธด ๋ฌธ์ œ์ด๋‹ค.

 

๊ทธ๋Ÿผ ์ด์ œ ๊ณ„์ •๊ถŒํ•œ์„ ์„ค์ •ํ•ด๋ณด์ž.

 

1) mysql์— ์ ‘์†

 

 

2) mysql ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ์ ‘์†

use mysql;

 

 

3) ๊ถŒํ•œ ๋ชฉ๋ก ์กฐํšŒ

select host, user from user;

 

ํ˜„์žฌ ์กฐํšŒ๋œ ๊ฐ’๋“ค์„ ์‚ดํŽด๋ณด๋ฉด

 

localhost์™€ % ํ•„๋“œ๊ฐ’์ด ๋“ค์–ด์žˆ๋Š” ๊ฒƒ์„ ์•Œ ์ˆ˜ ์žˆ๋‹ค.

 

localhost๋Š” ๋ง๊ทธ๋Œ€๋กœ ๋กœ์ปฌ์—์„œ๋งŒ ์ ‘์†์„ ํ—ˆ์šฉํ•˜๋Š” ๊ฒƒ์ด๊ณ ,

%๋Š” ์™ธ๋ถ€์—์„œ ๋ชจ๋“  IP์ ‘์†์„ ํ—ˆ์šฉํ•˜๋Š” ๊ฒƒ์ด๋‹ค.

( mkpm์€ ์™ธ๋ถ€์ ‘์†์ด ๊ฐ€๋Šฅํ•˜๊ณ , root๋Š” ์™ธ๋ถ€์ ‘์†์ด ๋ถˆ๊ฐ€๋Šฅํ•˜๋„๋ก ๊ถŒํ•œ ์„ค์ •์ด ๋˜์–ด ์žˆ๋‹ค.)

 

์šฐ๋ฆฌ๋Š” 'kithub'๋กœ ์™ธ๋ถ€์ ‘์†์„ ์›ํ•˜๋‹ˆ,

์™ธ๋ถ€์ ‘์† ๊ถŒํ•œ์„ ๊ฐ€์ง„ kithub ๊ณ„์ •์„ ๋งŒ๋“ค์–ด์ฃผ์ž.

 

 

4) ์™ธ๋ถ€์ ‘์† ๊ถŒํ•œ์„ ๊ฐ€์ง„ ๊ณ„์ • ๋งŒ๋“ค๊ธฐ

create user 'kithub'@'%' identified by 'password';

๊ฐ„ํ˜น

Operation CREATE USER failed for 'user'@'%' ์˜ค๋ฅ˜๊ฐ€ ๋œฌ๋‹ค๋ฉด

๋‹ค์Œ ๋ช…๋ น์–ด๋ฅผ ์‹คํ–‰์‹œ์ผœ์ฃผ๊ธฐ๋งŒ ํ•˜๋ฉด ๋œ๋‹ค.

flush privileges;

 

์‚ฌ์šฉ์ž ํ…Œ์ด๋ธ” ๋ฐ์ดํ„ฐ์— ๋ณ€๊ฒฝ์ด ๋ฐœ์ƒ ํ–ˆ๋‹ค๋ฉด

๋ฐ˜๋“œ์‹œ flush privileges;๋ฅผ ์‹คํ–‰ํ•˜์—ฌ ๋ณ€๊ฒฝ์‚ฌํ•ญ์„ ์ ์šฉ์‹œ์ผœ์ค˜์•ผํ•œ๋‹ค.

๊ทธ๋ ‡์ง€ ์•Š์œผ๋ฉด ์ผ๊ด€์„ฑ์ด ๊นจ์ ธ ์œ„์™€ ๊ฐ™์€ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ•˜๊ฒŒ ๋œ๋‹ค.

 

 

 

5) ์™ธ๋ถ€์ ‘์† ํ•˜๊ธฐ

์•„๋ž˜ ๋ชฉ๋ก์—์„œ 'kithub' ๊ณ„์ •์ด ์ถ”๊ฐ€๋œ๊ฒƒ์„ ํ™•์ธํ–ˆ์œผ๋‹ˆ 

์ ‘์†์„ ์‹œ๋„ํ•ด๋ณด์ž.

 

 

์ƒ์„ฑํ•œ ๊ณ„์ •๊ณผ ๋น„๋ฐ€๋ฒˆํ˜ธ ์ž…๋ ฅ

 

์งœ์ž”, ์•„๋ฌด๋Ÿฐ ๊ฑธ๋ฆผ๋Œ ์—†์ด ์™ธ๋ถ€์ ‘์†์ด ์„ฑ๊ณตํ–ˆ๋‹ค.

 

 

 

๊ทธ ์™ธ ๋ช…๋ น์–ด

 

์‚ญ์ œ : delete from user where user='๊ณ„์ •๋ช…';

๋ฐ˜์‘ํ˜•
๋Œ“๊ธ€