mysql ¿¡ Á¢¼ÓÇÏ´Â ¹æ¹ýÀ» ¾Ë¾ß¾ß ³ªÁß¿¡ php ¿Í ¿¬µ¿½Ã ÀÌÇØ°¡ ½±½À´Ï´Ù. mysql »ç¿ëÀÚ¶õ DB¿¡
Á¢¼ÓÇϱâ À§ÇÑ ¾ÆÀ̵ð¿Í ºñ¹Ð¹øÈ£¸¦ ¸»ÇÕ´Ï´Ù. »ç¿ëÀÚ ÀÎÁõ°ú °°½À´Ï´Ù. °£´ÜÇÏ°Ô mysqlÀ» »ç¿ëÇÒ ¼ö ÀÖ´Â
»ç¶÷ÀÇ ¾ÆÀ̵ð¿Í ºñ¹Ð¹øÈ£¸¦ ºÎ¿©ÇÏ´Â °ÍÀ̶ó°í »ý°¢Çϸé ÆíÇÕ´Ï´Ù.
ÀÌÇÏ mysqlÀÌ ±ò·ÁÀÖ´Â µð·ºÅ丮´Â /usr/local/mysql/ À̶ó Á¤ÀÇÇÕ´Ï´Ù.
µð·ºÅ丮 /usr/local/mysql/bin/ À¸·Î À̵¿ÇÕ´Ï´Ù.
±×¸®°í ½©»ó¿¡¼ ·çÆ®°èÁ¤À¸·Î Á¢¼ÓÇÕ´Ï´Ù. ´ÙÀ½Àº Á¢¼Ó°úÁ¤ÀÔ´Ï´Ù. shell>./mysql
mysql (enter)
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 10267 to server version: 3.21.33c
Type 'help' for help.
À§ÀÇ È¸éÀÌ ³ª¿À¸é Á¦´ë·Î Á¢¼ÓµÈ°ÍÀÔ´Ï´Ù. ´ÙÀ½ÀÇ ¼ø¼´ë·Î ÁøÇàÇսôÙ.
1. Á¢¼ÓÇÒ ¼ö ÀÖ´Â ±ÇÇѸ¸ °¡Áø »ç¿ëÀÚ¸¦ µî·ÏÇÕ´Ï´Ù. mysql>
insert into user values ('localhost','¾ÆÀ̵ð',password('ºñ¹ø'),'N','N','N','N','N','N','N','N','N','N');
¾ÆÀ̵ð : ÀÚ½ÅÀÌ »ç¿ëÇÒ ¾ÆÀ̵𸦠½á ÁÝ´Ï´Ù. (ex)wwwuser
ºñ¹ø : ¾ÆÀ̵𿡠ÇØ´çÇÏ´Â ¾ÏÈ£¸¦ ½áÁÝ´Ï´Ù. (ex)wwwuser
N : ÃÑ 10°³ ÀÔ´Ï´Ù.
2. ÀÌÁ¦ À§¿¡¼ ¸¸µç »ç¿ëÀÚ°¡ »ç¿ëÇÒ DB¿¡ ´ëÇÑ ±ÇÇÑÀ» ÁÝ´Ï´Ù. mysql>
insert into db values('localhost','»ç¿ëÇÒDB','À¯Àú¾ÆÀ̵ð','Y','Y','Y','Y','Y','Y');
»ç¿ëÇÒDB : ¾ÕÀ¸·Î ¸¸µé DB ÀÔ´Ï´Ù. ÀÚ½ÅÀÌ »ç¿ëÇÒ DBÀÇ À̸§À» ÀûÀ¸¸é µË´Ï´Ù.
À¯Àú¾ÆÀ̵ð : À§¿¡¼ ¸¸µç À¯Àú¸¦ ¾²¸é µË´Ï´Ù. (ex)wwwuser
3. mysqlÀÇ ·çÆ®°èÁ¤À» ºüÁ® ³ª¿É´Ï´Ù.
mysql> \q
Bye
4. »ç¿ëÇÒ DB ¸¸µé±â - À§¿¡¼ ÁöÁ¤ÇÒ DBÀÇ À̸§À» °¡Áø DB¸¦ ¸¸µì´Ï´Ù. shell>cd
/usr/local/msyql/bin
shell> mysqladmin create dbÀ̸§
Database "DBÀ̸§" created.
5. ¹Ýµå½Ã DB¸¦ Àеµ·Ï ¸®·Îµå ÇؾßÇÕ´Ï´Ù. shell>mysqladmin
reload
6. »õ·Î ¸¸µç ¾ÆÀ̵ð·Î mysql Á¢¼ÓÇϱâ shell>./mysql
-u¾ÆÀ̵ð -pºñ¹ø DBÀ̸§
¾ÆÀ̵ð : ¾Æ±î¸¸µç ¾ÆÀ̵𠿹¸¦ µé¾î wwwuser ¶ó°í ÇսôÙ.
ºñ¹ø : ¾Æ±î ¸¸µç ºñ¹ø ¿¹¸¦µé¾î wwwuser¶ó°í ÇսôÙ.
DBÀ̸§ : ¾Æ±î¸¸µç DB ¿¹¸¦ µé¾î bbs ¶ó°í ÇսôÙ.
±×·³ ´ÙÀ½°ú °°ÀÌ ÀÔ·ÂÇØ¾ß ÇÕ´Ï´Ù. shell>./msyql
-uwwwuser -pwwwuser bbs
ÀÌ·¸°Ô ÇÏ°í ¿£Å͸¦ Ä¡¸é ´ÙÀ½ÀÇ È¸éÀÌ ³ª¿À¸é ¼º°øÀÔ´Ï´Ù.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 10267 to server version: 3.21.33c
Type 'help' for help.
mysql>
ÀÚ ÀÌÁ¦ mysqlÀ» ¸¶À½´ë·Î ÇÒ ¼ö ÀÖ½À´Ï´Ù.
|
|