Ãâó: http://lse.pe.kr ±Û¾´ÀÌ: ¹Î¼ö
¾È³çÇϼ¼¿ä?
db À¯Àú¸¦ ¸¸µé¶§ ¸Å¹ø À¯Àú¸¦ ¸¸µé°í µ¥ÀÌŸ º£À̽º¸¦ ¸¸µé°í ±× µ¥ÀÌŸ º£À̽º¿¡ ´ëÇÑ ±Ç
ÇÑÀ» ÁÖ°í... ³Ê¹« ºÒÆÝ ÇÑ°Í °°¾Æ¼ ±×³É °£´ÜÇÏ°Ô Â¥ ºÃ½À´Ï´Ù.
Çü½ÄÀº ¸î°¡Áö¸¦ ÀÔ·Â¹Þ¾Æ º¯¼ö¿¡ ÀúÀåÈÄ º¯¼ö¸¦ ÀÌ¿ëÇØ ±âº»ÀûÀÎ °³Á¤ »ý¼ºÀÔ´Ï´Ù.
ÀÏ´Ü ROOTPASS ºÎºÐÀº db root password¸¦ ³Ö¾î Áֽñ⠹ٶø´Ï´Ù.
#!/bin/sh
ROOTPASS="passwd"
echo -n "ID: "
read ID
echo -n "PASSWD: "
read PASS
echo -n "DATABASE NANE: "
read DNAME
MYSQL="/usr/local/mysql/bin/mysql"
echo "insert into user values('localhost','${ID}',password('${PASS}'),('n','n','
n','n','n','n','n','n','n','n','n','n','n','n');" > /tmp/useradd.sql
echo "create database ${DNAME};" >> /tmp/useradd.sql
echo "insert into db values('%','${DNAME}','${ID}','y','y','y','y','y','y','y'
,'y','y','y');" >> /tmp/useradd.sql
echo "flush privileges;" >> /tmp/useradd.sql
$MYSQL -uroot -p${ROOTPASS} mysql < /tmp/useradd.sql
rm -rf /tmp/useradd.sql
Á»µµ ±â´ÉÀÌ È®ÀåµÈ ¹öÀüÀ» ¸¸µé¾î¾ß °Ú³×¿ä...
´ÙÀ½¹ø¿¡´Â °èÁ¤ »ý¼ººÎÅÍ ½ÃÀÛÇؼ ³×ÀÓ¼¹ö ¼ÂÆà ¾ÆÆÄÄ¡ ¹öó È£½ºÆ® ¸ÞÀÏ ¼³Á¤ db ±îÁö
Çѹø¿¡ °¡´ÉÇÑ ½©À» ¸¸µé¾î º¸°Ú½À´Ï´Ù.^^
dbºÎºÐÀº ±ÇÇÑÀ» ¾î¶»°Ô ¼³Á¤ÇÒ°ÍÀÎÁö ÁöÁ¤ÇÏ´Â Çʵ带 ¸¸µé¾î º¸µµ·Ï ÇÏÁÒ^^
±×·³ À̸¸...
|