B / Y / U / S
HOME À¥ È£½ºÆà µµ¸ÞÀÎ ¸Å´º¾ó °í°´Áö¿ø ¼³Á¤Á¤º¸ °èÁ¤½Åû 2024-12-23 Monday 
À¥ È£½ºÆÃ
# °øÁö »çÇ×
# ÀÚÁÖ ¹¯´Â Áú¹®
# Áú¹®°ú ´äº¯
# °¡ÀÔ ¹®ÀÇ
Ä¿¹Â´ÏƼ
# ÀÚÀ¯°Ô½ÃÆÇ
# ¸®´ª½ºÆÁ
# ¾ÆÀÌÅ¥ Å×½ºÆ®
# ³»È¨ ¼Ò°³
# °Ö·¯¸®
# ÀÚ·á½Ç

  ¸®´ª½ºÆÁ  Go Unix Power Tools Online Book Go Bash Guide
Read No. 108 article 2002-02-22 04:49:35
NickName   Ç®ºñ´©
Subject   [TIP] ÃÊ°£´Ü DB À¯Àú »ý¼º½©
Ãâó: 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ºÎºÐÀº ±ÇÇÑÀ» ¾î¶»°Ô ¼³Á¤ÇÒ°ÍÀÎÁö ÁöÁ¤ÇÏ´Â Çʵ带 ¸¸µé¾î º¸µµ·Ï ÇÏÁÒ^^

±×·³ À̸¸...
Regist Addr [ 192.168.0.2 ] ¸ñ·Ïº¸±â À­±Û ¾Æ·§±Û
Á¤±ÔÇ¥Çö½Ä [ »ó¼¼ °Ë»ö ]
Page Loading [ 0.02 Sec ] SQL Time [ 0 Sec ]

Copyleft 1999-2024 by JSBoard Open Project
Theme Designed by IDOO And follow GPL2

°³ÀÎÁ¤º¸ Ãë±Þ¹æħ ÀÌ¿ë ¾à°ü »çÀÌÆ® ¸Ê ¾îµå¹Î °ü¸®