BACKRUSH  À¯´Ð½º¸í·É  ´ÙÀ½  ÀÚ·á½Ç  Ascii Table   ¿ø°ÝÁ¢¼Ó  ´Þ·Â,½Ã°£   ÇÁ·Î¼¼½º   ½©
ÁöÇÏö³ë¼±   RFC¹®¼­   SUN FAQ   SUN FAQ1   C¸Þ´º¾ó   PHP¸Þ´º¾ó   ³Ê±¸¸®   ¾Æ½ºÅ°¿ùµå ¾ÆÀÌÇǼ­Ä¡

±Û¾´ÀÌ: mysql mysql ¾îµå¹Î Á¶È¸¼ö: 7365


¸ÕÀú ¿Ã¸° °­Á¸¦ º¸°í ¹è¿î »ç¶÷ÀÌ ´Ù½Ã ¾´ Ãʺ¸¿ë °­ÁÂÀÔ´Ï´Ù.
¿ª½Ã Hitel¿¡¼­ °¡Á®¿Ô±¸¿ä. ÇÊ¿äÇϽźРÀÖÀ»²¨ °°¾Æ¼­...
±×·³ ¶Ç»ð


Á¦ ¸ñ:[Á¤¸®] Ãʺ¸ÀÚ¿ë MySQL ½Ç½À1 °ü·ÃÀÚ·á:¾øÀ½ [934]
º¸³½ÀÌ:Àå¿øö (ich7 ) 1999-10-17 01:46 Á¶È¸:4121


========================================
-- ÀÛ¼ºÀÚ : Àå¿øö
-- ÀÛ¼ºÀÏ : 1999.10.17
-- Hitel : ich7
-- E-mail : fast_ethernet@hotmail.com
-- HOME : http://free.kobis.net
========================================
´ÙÀ½ÀÇ ±ÛÀº 2°¡ÁöÀÇ ¹°À½¿¡ ³ª¸§´ë·Î Ãæ½ÇÇÑ ´äº¯À» ³»¸®°íÀÚ
Á¦ ½º½º·Î ¹¯°í ´äÇÑ °á°ú¹°ÀÔ´Ï´Ù. Àú¿Í ºñ½ÁÇÑ ÃʽÉÀÚ¿¡°Ô
¸¹Àº µµ¿òÀÌ µÇ´Â ±ÛÀÌ µÇ¾úÀ¸¸é Á¤¸» ±â»Ú°Ú½À´Ï´Ù.


1> ÇØ´ç ½Ã½ºÅÛ¿¡¼­ mysqlÀ» »ç¿ëÇÒ¼ö ÀÖ´ÂÁö È®ÀÎÇÏ´Â ¹æ¹ýÀº ?
2> mysqlÀ» ÀνºÅçÇÏ°í µ¥¸óÇÁ·Î¼¼½º±îÁö È®ÀÎÇߴµ¥, ¹«¾ùºÎÅÍ ¼ÕÀ» ´ë¾ß ÇÏ´ÂÁö?

½Ã½ºÅÛȯ°æ ¹× MySQL ¹öÀüÁ¤º¸
¡å¡å¡å¡å¡å¡å¡å¡å¡å¡å¡å¡å¡å¡å¡å¡å¡å¡å¡å¡å¡å¡å¡å¡å¡å¡å¡å¡å¡å¡å¡å¡å¡å
SunOS superman 5.6 Generic sun4u sparc SUNW,Ultra-2
mysql Ver 9.32 Distrib 3.22.24, for sun-solaris2.6 (sparc)

Linux free.kobis.net 2.2.5-15 #1 Mon Apr 19 23:00:46 EDT 1999 i686
mysql Ver 9.33 Distrib 3.22.25, for pc-linux-gnu (i686)
¡ã¡ã¡ã¡ã¡ã¡ã¡ã¡ã¡ã¡ã¡ã¡ã¡ã¡ã¡ã¡ã¡ã¡ã¡ã¡ã¡ã¡ã¡ã¡ã¡ã¡ã¡ã¡ã¡ã¡ã¡ã¡ã¡ã

root »ç¿ëÀÚÀÇ ±ÇÇÑÀ¸·Î ½ÇÇàµÇ 2°³ÀÇ ÇÁ·Î¼¼½º°¡ ½ÇÇàµÇ°í ÀÖ´ÂÁö È®ÀÎÇÏ¸é µÈ´Ù.
safe_mysqld ¿Í mysqld ÀÌ´Ù. ¹°·Ð ½Ã½ºÅÛÀÇ »óÅ¿¡ µû¶ó Æ÷Å©(fork)µÈ ÀÚ½ÄÇÁ·Î¼¼½º

ÀÇ °³¼ö´Â ¿©·¯°³Àϼö ÀÖ´Ù.
-------------------------------------------------------------------------------

¼Ö¶ó¸®½º°æ¿ì:
% ps -ef | grep mysql

root 21768 21757 0 10¿ù 15 ? 0:00 /usr/local/mysql/bin/mysqld --bas
edir=/usr/local/mysql --datadir=/usr/local/mys
root 21757 1 0 10¿ù 15 ? 0:00 /bin/sh /usr/local/mysql/bin/saf
e
_mysqld

¸®´ª½º°æ¿ì:
$ ps -auxw | grep mysql

root 546 0.0 0.1 1664 796 ? S Sep27 0:00 sh /usr/local/my
s
ql/bin/safe_mysqld
root 573 0.0 0.4 12680 2564 ? SN Sep27 0:12 /usr/local/mysql
/
libexec/mysqld --basedir=/usr/local/mysql --datadir=
root 576 0.0 0.4 12680 2564 ? SN Sep27 0:10 /usr/local/mysql
/
libexec/mysqld --basedir=/usr/local/mysql --datadir=
root 577 0.0 0.4 12680 2564 ? SN Sep27 0:00 /usr/local/mysql
/
libexec/mysqld --basedir=/usr/local/mysql --datadir=
-------------------------------------------------------------------------------
-



database ÇÁ·Î±×·¥À» ¼³Ä¡ÇÏ°í »ç¿ëÇϱâ·Î ¸¶À½À» ¸Ô¾ú´Ù°í ÇÏ´õ¶óµµ ½±°Ô »õ·Î¿î
ȯ°æ¿¡ Á¢±ÙÇϱâ¶õ ¸»Ã³·³ ½±Áö°¡ ¾Ê´Ù. ±×·¸±â ¶§¹®¿¡ ÀÌ·¸°Ô ±ÛÀ» ¾²°í
ÀÖ´Â ÀÌÀ¯À̱⵵ ÇÏ´Ù. °³¹ßÀÚ°¡ ÇÁ·Î±×·¥À» ¸¸µå´Â ÀÌÀ¯°¡ ÀÚ½ÅÀÇ °¡·Á¿î °÷À»
ÇØ°áÇϱâ À§Çؼ­¶ó´Â ¸»ÀÌ ÀÖ´Ù. Áö±ÝÀÇ ³ª ¿ª½Ã ±×·± °¡·Á¿î °÷À» ½º½º·Î ¹ß°ßÇÏ·Á
°í
³ë·ÂÇÏ°í ÀÖ°í ±»ÀÌ ½Ã°£À» ÅõÀÚÇØ ÀÌ·¸°Ô Á¤¸®Çϴµ¥´Â ³ª¸§´ë·ÎÀÇ ¹ßÀüÀ» ±â´ëÇϱâ

¶§¹®ÀÌ´Ù. SQL(Structured Query Language)À̶õ ¾ð¾î¿Í DBMS(Database Management Sy
stem)
¶ó´Â ½Ã½ºÅÛÀº ¿©·¯ºÐÀÌ ¾Ë°í ÀÖ´Ù°í ÀüÁ¦ÇÏ°í ±ÛÀ» ½á ³ª°¥ »ý°¢ÀÌ´Ù.
»ç¶÷¿¡ µû¶ó¼­´Â mysqlÀ» ½ÃÀÛÇÏ°Ô µÈ ¹è°æÀÌ ¼­·Î ´Ù¸£°ÚÁö¸¸, ³ªÀÇ °æ¿ì´Â À¥ÆäÀÌ
Áö¿ë
À¸·Î »ç¿ëÇϱâ À§ÇØ mysqlÀ» ¼±ÅÃÇÏ°Ô µÇ¾ú´Ù. µû¶ó¼­ ¿ì¼±Àº ¿øÇÏ´Â Å×À̺íÀ» »ý¼º
ÇÒ ¼ö ÀÖ´Â
±ÇÇÑÀ» ¾ò´Â°ÍÀ¸·Î ºÎÅÍ mysqlÀ» ´õµë¾î º¸±â·Î ÇÑ´Ù.

µÎ°¡ÁöÀÇ °æ¿ì°¡ Á¸ÀçÇÒ ¼ö ÀÖ´Ù. root Àϼö ÀÖ°í ÀϹÝuser(ÀÌÇÏ user)Àϼö°¡ ÀÖ´Ù.

rootµÈ ÀÚÀÇ µµ¸®¿Í userµÈ ÀÚÀÇ µµ¸®´Â ´Ù¸¦¼ö ¹Û¿¡ ¾ø´Ù. ¼­·Î°¡ óÁö¸¦ È¥µ¿Çϸé
¸ÖƼÀ¯Àú ½Ã½ºÅÛÀº Èçµé¸®°Ô µÈ´Ù.

¸ÕÀú rootµÈ ÀÚÀÇ µµ¸®´Â userµéÀ» À§ÇÑ ÃÖÀûÈ­µÈ ȯ°æÀ» Á¶¼ºÇØ¾ß ÇÑ´Ù. ±×Áß¿¡¼­
µµ °¡Àå
Áß¿äÇÑ °ÍÀº userÀÇ µ¥ÀÌÅ͸¦ ¼Õ»óµÇÁö ¾Ê°Ô º¸Á¸ÇÏ´Â Á¤±ÔÀûÀÎ ¹é¾÷ÀÛ¾÷ÀÌ°í ¶ÇÇÑ
±ÇÇѾø´Â ÀڷκÎÅÍ ¹Î°¨ÇÑ µ¥ÀÌÅ͸¦ º¸È£ÇÒ¼ö ÀÖ´Â º¸¾È¼³Á¤ÀÌ µÉ °ÍÀÌ´Ù.

±¸Ã¼ÀûÀÎ °ÍÀº °¢°¢ÀÇ µµ¸®¸¦ ¾Ë°í³ª¼­ ÇÒÀÏÀÌÁö¸¸, ¿©±â¼­´Â Å©°Ôº¸¾Æ ÇàÇØ¾ß ÇÏ´Â
µµ¸®¸¦
»ìÆ캸´Â °ÍÀ¸·Î Áú¹®À» ¿Ï¼ºÇØ º»´Ù.

mysql ÀÌ ¼³Ä¡°¡ µÇ°í ³ª¸é, /usr/local/mysql/bin À̶ó´Â µð·ºÅ丮¿¡ ½ÇÁ¦·Î »ç¿ëÇÒ
¼ö ÀÖ´Â
À¯Æ¿¸®Æ¼(¸í·É¾î)¸¦ º¼¼öÀÖ´Ù. ÀÌÁß¿¡¼­ ´çÀå ÇÊ¿äÇÑ °ÍÀº mysql À̶ó´Â ¸í·É¾îÀÌ´Ù.

mysql Àº mysql µ¥ÀÌÅͺ£À̽º¿¡ ·Î±×¿ÂÇÒ¼ö ÀÖ´Â ÇÁ·Î±×·¥ÀÌ´Ù.
»ç¿ë¹ýÀº ´ÙÀ½°ú °°´Ù.

# mysql mysql <Enter> // rootÀÇ °æ¿ì

% mysql -u»ç¿ëÀÚ¸í -pÆнº¿öµå DB¸í // userÀÇ °æ¿ì

¹«¸© root¿Í userµÈ ÀÚÀÇ µµ¸®¸¦ ¸»ÇÑ ÀÌÀ¯´Â ´ÜÁö ´Ü¾îÀÇ Â÷ÀÌ°¡ ¾Æ´Ï´Ù.
À§¿¡¼­ º¸µíÀÌ ±× Â÷ÀÌ´Â ½ÇÁ¦·Î º¸ÀδÙ.
Á¢±ÙÇÒ ¼ö ÀÖ´Â µ¥ÀÌÅͺ£À̽º¿¡ Â÷µîÀÌ ÀÖ´Ù. ±×·¡¼­ root¿¡°Ô´Â ¶Ç´Ù¸¥ À̸§ÀÌ
ºÎ¿©°¡ µÈ´Ù. ´Ù¸§¾Æ´Ñ DBA(database administrator)°¡ ±×°ÍÀÌ´Ù.
mysqlÀ̶ó´Â DB´Â °ü¸®ÀÚ¿ë µ¥ÀÌÅͺ£À̽º·Î ¼³Ä¡½Ã¿¡ ±âº»ÀûÀ¸·Î ÀνºÅçµÇ´Â °ÍÀ̸ç,

-¹°·Ð mysql ÀνºÅç½Ã Ãʱ⼳Á¤ ½ºÅ©¸³Æ®ÆÄÀÏ(mysql_install_db)¸¦ ½ÇÇàÇØ¾ß ÇÔÀº ´ç
¿¬ÇÏ´Ù-
ÀϹÝÀ¯Àú´Â Á¢±ÙÀ» ÇÒ ¼ö ¾ø´Ù.
mysql¸¦ óÀ½À¸·Î »ìÆ캸°Ô µÇ¸é 2°³ÀÇ DB°¡ Á¸ÀçÇÔÀ» ¾Ë¼ö ÀÖ´Ù.
mysql,test ¶ó´Â À̸§ÀÇ DB°¡ ±×°ÍÀÌ´Ù.
mysqlÀº DBÀüü¿¡ ´ëÇÑ °ü¸®ÀÚ°Ý DBÀ̸ç, ÀÌ°÷¿¡´Â mysql¿¡ Á¸ÀçÇÏ´Â DBÀÇ À̸§°ú
ÇØ´çDBÀÇ ¼ÒÀ¯ÀÚ, »ç¿ë±ÇÇÑ µîÀÌ ¼³Á¤µÇ´Â °÷ÀÌ´Ù. ¸»ÇÏÀÚ¸é mysqlÀ» ÃÑ°ýÇÏ´Â ÃÖ»ó
ˤ
Á¸Àç¶ó°í º¸¸é ÀÌÇØÇϱ⠽±´Ù. ±×·¡¼­ user´Â Á¢±ÙÇؼ­µµ ¾ÈµÇ¸ç,³Ñº¸¾Æ¼­µµ ¾ÈµÈ´Ù.

root°¡ mysql DB¿¡ ·Î±×¿ÂÇÏ´Â °ÍÀÌ´Ù. ±×¸®°í ³ª¼­ userµéÀ» À§ÇÑ °ø°£À» ºÐÇÒÇØ ÁÖ
¾î¾ß
ÇÑ´Ù. ±×°ÍÀÌ ÃÖÃÊÀÇ ÀÛ¾÷ÀÌ µÉ °ÍÀÌ´Ù.
mysql DB¿¡ ÁøÀÔÇÏ°Ô µÇ¸é ¸ÕÀú ±× ¾È¿¡ ¹¹°¡ µé¾îÀÖ´ÂÁö »ìÆì¾ß ÇÑ´Ù.
DB¾È¿¡ Å×À̺íÀÌ µé¾îÀÖ´Ù. ¿©±â¼­ ¿À¶óŬÀ» °øºÎÇÑ »ç¶÷ÀÌ Å×ÀÌºí½ºÆäÀ̽º À̾߱⸦
Çϸé
³­ ÀÚ½ÅÀÌ ¾ø´Ù. MSSQL°ú ORACLEÀÌ ¾ÆÁÖ »óÀÌÇÑ ¾ÆÅ°ÅØÃĸ¦ °¡Áø °Íó·³ MySQLµµ ¾Æ
ÁÖ
»óÀÌÇÑ °Í °°´Ù. ³ªÀÇ »ý°¢ÀÌÁö¸¸, ±â¿ÕÀ̸é ORACLEÀ» ÃÖÃÊ·Î °øºÎÇصδ °ÍÀÌ ´Ù¸¥
DBMS
¿¡ Á¢±ÙÇϱ⠿ëÀÌÇÒ °Í °°´Ù. ³ªÀÇ °æ¿ì¿£ ACESS¿Í MSSQLÀ» ¸ÕÀúÇÏ°í ORACLEÀ» °øºÎ
ÇÏ°Ô
µÇ¾ú´Âµ¥, Database¶ó´Â ¿ë¾îµµ óÀ½¿¡´Â È¥µ¿ÀÌ µÇ¾ú´Ù. ¹°·Ð Áö±Ýµµ Àß ¸ð¸£°ÚÁö¸¸
...
show tables;¶ó´Â ¸í·ÉÀÌ ÀÖ´Ù. ¿À¶óŬÀÇ °æ¿ì´Â select * from tab; À» »ç¿ëÇß´ø ±â
¾ïÀÌ
³ªÁö¸¸, mssqlÀº ÀÌ·±·ùÀÇ SQL¹®À» ½á º» ±â¾ïÀÌ ¾ø´Â °Í °°´Ù.
±×³É guiȯ°æ¿¡¼­ ¸¶¿ì½º¸¦ Ŭ¸¯Çؼ­ º» ³»¿ë ¿Ü¿¡´Â ...

´ÙÀ½Àº root »ç¿ëÀÚ·Î mysql DB¿¡ ÁøÀÔÇÑ ´ÙÀ½¿¡ »ç¿ëÇÑ ¸í·É¾îÀÌ´Ù.

mysql> show tables;
+-----------------+
| Tables in mysql |
+-----------------+
| columns_priv |
| db |
| func |
| host |
| tables_priv |
| user |
+-----------------+
6 rows in set (0.00 sec)

´ÙÀ½ÀÇ ¸í·É¾î´Â ¹Ýµå½Ã »ç¿ëÇØ º¸¾ß¾ß ÇÑ´Ù. desc(describe)´Â Å×À̺íÀÇ ±¸Á¶¸¦ º¸
¿©ÁØ´Ù.
Å×À̺íÀÇ ±¸Á¶¿Í ³»¿ëÀº ´Ù¸£´Ù. ±¸Á¶´Â ¹º°¡¸¦ ä¿ì´Â Çü½ÄÀÌ°í ³»¿ëÀº ä¿öÁö´Â ¼Ó
¾Ë¸ÍÀÌ´Ù.

mysql> desc db; desc user; desc host; desc tables_priv; desc func; desc colums_
priv
mysql> desc db;
+-----------------+---------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------------+---------------+------+-----+---------+-------+
| Host | char(60) | | PRI | | |
| Db | char(32) | | PRI | | |
| User | char(16) | | PRI | | |
| Select_priv | enum('N','Y') | | | N | |
| Insert_priv | enum('N','Y') | | | N | |
| Update_priv | enum('N','Y') | | | N | |
| Delete_priv | enum('N','Y') | | | N | |
| Create_priv | enum('N','Y') | | | N | |
| Drop_priv | enum('N','Y') | | | N | |
| Grant_priv | enum('N','Y') | | | N | |
| References_priv | enum('N','Y') | | | N | |
| Index_priv | enum('N','Y') | | | N | |
| Alter_priv | enum('N','Y') | | | N | |
+-----------------+---------------+------+-----+---------+-------+
13 rows in set (0.00 sec)
mysql> desc user;
+-----------------+---------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------------+---------------+------+-----+---------+-------+
| Host | char(60) | | PRI | | |
| User | char(16) | | PRI | | |
| password | char(16) | | | | |
| Select_priv | enum('N','Y') | | | N | |
| Insert_priv | enum('N','Y') | | | N | |
| Update_priv | enum('N','Y') | | | N | |
| Delete_priv | enum('N','Y') | | | N | |
| Create_priv | enum('N','Y') | | | N | |
| Drop_priv | enum('N','Y') | | | N | |
| Reload_priv | enum('N','Y') | | | N | |
| Shutdown_priv | enum('N','Y') | | | N | |
| Process_priv | enum('N','Y') | | | N | |
| File_priv | enum('N','Y') | | | N | |
| Grant_priv | enum('N','Y') | | | N | |
| References_priv | enum('N','Y') | | | N | |
| Index_priv | enum('N','Y') | | | N | |
| Alter_priv | enum('N','Y') | | | N | |
+-----------------+---------------+------+-----+---------+-------+
17 rows in set (0.00 sec)


±×¸®°í ´ÙÀ½ÀÇ ¸í·É¾î·Î ÇØ´çÅ×À̺íÀÌ º¸À¯ÇÏ°í ÀÖ´Â µ¥ÀÌÅ͸¦ µé¿©´Ùº»´Ù.
mysql> select * from Å×À̺í¸í;

mysql> select * from func;
Empty set (0.00 sec)

mysql> select * from tables_priv;
Empty set (0.01 sec)

mysql> select * from host;
Empty set (0.00 sec)

ºñ¾îÀְųª ³»¿ëÀÌ ³ª¿Í¾ß ÇÑ´Ù.
user,dbÅ×À̺íÀº º¸¾È»ó °ø°³ÇÏÁö ¾Æ´ÏÇϱâ·Î ÇÑ´Ù.
Á÷Á¢¸í·É¾î¸¦ ÀÔ·ÂÇØ º¸¸é ¾Ë°Ô µÉ °ÍÀÌ´Ù.

mysql> select * from db; ¸í·ÉÀÇ °æ¿ì´Â mysql¿¡ ¼³Ä¡µÈ »ç¿ëÀÚ DB¿¡ ´ëÇÑ Á¤º¸¸¦
ÇÁ¸°Æ®ÇØ ³¾ °ÍÀÌ´Ù.
mysql> select * from user; ¸í·ÉÀº ½Ã½ºÅÛÀÇ ¸íĪ(localhost,È£½ºÆ®¸í)°ú
»ç¿ëÀÚ(root)¸¦ Á¤ÀÇÇÏ°í ÀÖ´Ù.

mysql DB ³»ÀÇ db,userÅ×À̺íÀ» º¼¼ö ÀÖ´Â À¯ÀÏÇÑ Á¸Àç´Â rootÀÓÀ» ÀǽÉÇÏÁö ¸»ÀÚ.
db,user Å×À̺íÀÇ ³»¿ëÀ» ¾Ë°í ÀÖ´Ù¸é Àû¾îµµ °°Àº È£½ºÆ®»óÀÇ ¾î¶² À¯Àú¶óµµ
ºÒ¹ýÀûÀ¸·Î ³²ÀÇ µ¥ÀÌÅ͸¦ ³Ñº¼¼ö ÀÖ´Ù. º¸´Â Â÷¿ø¿¡¼­ ³¡³ª¸é ´ÙÇàÀÌÁö¸¸,
½ÉÈ÷ ÈѼÕÀ» ½ÃÅ°°Å³ª ¾Æ¿¹ »èÁ¦ÇÒ ¼ö µµ Àֱ⠶§¹®ÀÌ´Ù.
±×·¡¼­ root´Â ÀüÁöÀü´ÉÇØ¾ß ÇÑ´Ù.
´ÙÀ½Àº free¶ó´Â ÀϹÝÀ¯Àú°¡ mysql DB¸¦ ¹üÇÏ·Á°í ½ÃµµÇغ» °á°úÀÌ´Ù.

% mysql -ufree -pÆнº¿öµå free

mysql> show databases;
+------------+
| Database |
+------------+
| artbe |
| bookdown |
| boxing |
| codicom |
| cybervoice |
| ehf |
| free |
| mornsun |
| mysql |
| reload |
| sharezone |
| superman |
| techstar |
| test |
| uahome |
+------------+
15 rows in set (0.00 sec)

mysql> desc mysql;
ERROR 1146: Table 'free.mysql' doesn't exist
¹°·Ð root¶ó°í ÇÒÁö¶óµµ desc¸í·ÉÀ» µ¥ÀÌÅͺ£À̽º¿¡ ³»¸°´Ù¸é,
¶È°°Àº ¿¡·¯¸¦ ¸¸³­´Ù. ´ÜÁö Çã¿ëµÇÁö ¾Ê´Â ±ÇÇÑÀ» Çà»çÇÑ ¿¹¸¦ º¸ÀμÀÀÌ´Ù.

¹æ±ÝÀü¿¡ ¾ð±ÞÇßµíÀÌ ¾ÆÆÄÆ®¸¦ »õ·Î Áö¾ú´Ù°í ÇÏÀÚ.
¾ÆÆÄÆ®À̸§ÀÌ mysqlÀÌ°í °ü¸®ÀÚ´Â rootÀÌ´Ù. ±×¸®°í ÀÌ ¾ÆÆÄÆ®´Â localhost³»Áö
°íÀ¯À̸§(host name)À̶ó´Â ÁÖ¼Ò¸¦ °®°Ô µÈ´Ù.
±×·¡¼­ ¿ÜºÎ¿¡¼­ ÀÌ ¾ÆÆÄÆ®(mysql)¿¡ ¿À·Á¸é root@localhost ÀÌ·±½ÄÀ¸·Î Á¢±ÙÇÏ°Ô µÈ
´Ù.
free¶ó´Â ÀϹݻç¿ëÀÚ°¡ Çã°¡¾øÀÌ Á¢±ÙÇÏ´Â °æ¿ì´Â
¹Ýµå½Ã ´ÙÀ½°ú °°Àº °æÇèÀ» ´çÇÏ°Ô µÈ´Ù.

% mysql mysql
ERROR 1045: Access denied for user: 'free@localhost' (Using password: NO)

À§ÀÇ °æ¿ì´Â free¶ó´Â ÀÏ¹Ý »ç¿ëÀÚ°¡ °Ìµµ ¾øÀÌ mysql °ü¸®ÀÚDB¸¦ ¹üÇÏ·Á°í ÇßÀ»¶§,
¸¸³ª´Â ¿¡·¯ÀÌ´Ù.
mysql -uroot -p¸¶À½´ë·Î mysql
ÀÌ·± ½ÄÀÇ ¸í·ÉÀ» Çϸé, mysqlÀº ¼ø¼öÈ÷ ¹Þ¾ÆµéÀÌÁö ¾ÊÀ» °ÍÀÌ´Ù.
±×·¯³ª ÇÑ°¡Áö ¹æ¹ýÀº ÀÖ´Ù. ÇØÅ·(?) ...
±×°ÍÀº °ü¸®ÀÚÀÇ ¼ÒȦ·Î mysql DB¿¡ Æнº¿öµå¸¦ °ÉÁö ¾Ê¾ÒÀ» °æ¿ìÀÌ´Ù.
±×·¯¸é ÀÏ¹Ý À¯Àúµµ ´ÙÀ½°ú °°ÀÌ mysql¿¡ Á¢±ÙÇÒ ¼ö ÀÖ´Ù.
% mysql -uroot mysql
Á¤¸» ¹«¼­ºì ÀÏÀÌ´Ù.
±×·¯´Ï rootµÈ Àڴ óÀ½¿¡ ¹Ýµå½Ã mysql DB¿¡ Æнº¿öµå¸¦ °É¾î¾ß ÇÑ´Ù.

mysql> update user
-> set password = password('testpass')
-> where user = 'root';
Query OK, 2 row affected (0.00 sec)
À§¸¦ ½ÇÇàÇϸé ÀϹÝÀûÀ¸·Î user Å×À̺í»ó¿¡ root»ç¿ëÀÚ°¡
localhost¿Í host¸íÀ¸·Î 2°³ µî·Ï µÇ¾î ÀÖÀ¸¹Ç·Î
2 row ÀÇ ºñ¹Ð¹øÈ£°¡ º¯°æÀÌ µÈ´Ù.
ÀÚ ÀÌÁ¦ºÎÅÍ´Â admin À¯ÀúÀÎ root·Î mysql¿¡ Á¢¼ÓÇÒ °æ¿ì ²À password¸¦
ÀÔ·ÂÇØ¾ß ÇÑ´Ù. Áï ¾Æ·¡¿Í °°ÀÌ ½ÇÇàÇÏ¿©¾ß ÇÑ´Ù.
$ mysql -uroot mysql
Enter password:
¾ÏÈ£¸¦ ¹°À»¶§ ¾ÏÈ£¸¦ ÀÔ·ÂÇϸé mysqlÀ» »ç¿ëÇÒ¼ö ÀÖ´Ù.

¿©±â¼­ Çϳª ¤°í ³Ñ¾î°¡ÀÚ. À¯´Ð½º½Ã½ºÅÛ¿¡ ·Î±×ÀÎÇÏ´Â °ÍÇÏ°í,
µ¥ÀÌÅͺ£À̽º¿¡ ·Î±×ÀÎÇÏ°í ÇÏ´Â °ÍÀº ¼­·Î ºÐ¸®µÈ ¿µ¿ªÀ̶ó´Â °ÍÀÌ´Ù.
·çÆ®·Î À¯´Ð½º½Ã½ºÅÛ¿¡ ·Î±×ÀÎÇß´Ù°í Çؼ­, mysql DB¿¡ Á¢±ÙÇÏ´Â Æнº¿öµå¸¦
Àؾî¹ö·È´Ù¸é mysql¿¡ ·Î±×ÀÎÇÒ¼ö¾ø´Ù. ´ÜÁö mysqlÀÚü¸¦ ½Ã½ºÅÛ¿¡¼­ Á¦°ÅÇϵçÁö
»õ·Î ÀνºÅçÇÏ´Â ¼±Åùۿ¡´Â ¾ø´Ù.

ÀÌÁ¦±îÁö ÀßÀº Á¤¸®µÇÁø ¾ÊÁö¸¸, rootµÈ ÀÚÀÇ µµ¸®¸¦ ´ë°­ »ìÆ캸¾Ò´Ù.
ÀÌÁ¨ userµÈ ÀÚ¸¦ mysqlÀ̶ó´Â °ø°£À¸·Î Åë°ú½ÃÄÑÁÙ ÀýÂ÷°¡ ÇÊ¿äÇÏ´Ù.
ÀÌ ¿ª½Ã rootµÈ ÀÚ¸¸ÀÇ µµ¸®ÀÌ´Ù.
»ç½Ç ÀÌ ÀÚü°¡ DBA¿¡ °üÇÑ ³»¿ëÀ̱⿡ userµÈ ÀÚÀÇ µµ¸®´Â ÀÚ½ÅÀÇ Ã³Áö¸¦
Àß ¾Æ´Â ÀÏ¿Ü¿¡´Â ÇÒÀÏÀÌ ¾ø´Ù°í º»´Ù. ¸»ÇÏÀÚ¸é, ÀÚ±âÁý¾È¿¡¼­ »ì¸²¸¸
Àß ÇÏ¸é µÈ´Ù´Â À̾߱âÀÌ´Ù.

Á¦ ¸ñ:[Á¤¸®] Ãʺ¸ÀÚ¿ë MySQL ½Ç½À2 °ü·ÃÀÚ·á:¾øÀ½ [935]
º¸³½ÀÌ:Àå¿øö (ich7 ) 1999-10-17 01:47 Á¶È¸:2141


========================================
-- ÀÛ¼ºÀÚ : Àå¿øö
-- ÀÛ¼ºÀÏ : 1999.10.17
-- Hitel : ich7
-- E-mail : fast_ethernet@hotmail.com
-- HOME : http://free.kobis.net
========================================
;
¿¬°áµÈ ±ÛÀÔ´Ï´Ù.
;
;


¾ÆÆÄÆ®¸¦ ºÐ¾çÇØ º¸ÀÚ... ¾ÆÆÄÆ®´Â °¢°¢ÀÇ µ¿°ú È£·Î ³ª´©¾î Áø´Ù.
ÇϳªÀÇ µ¿ÀÌ À־ ¿©·¯»ç¶÷À» ¼ö¿ëÇØ¾ß ÇÑ´Ù°í °¡Á¤ÇÏÀÚ.
¾ÆÆÄÆ®¿¡ ÀÔÁÖÇÏ°Ô µÉ(°èÁ¤»ç¿ëÀÚ) »ç¶÷µéÀÇ ¸í´ÜÀ» È®º¸ÇÏ°í ±×°Í¿¡ ´ëÇÑ
Æнº¿öµå¸¦ ÁöÁ¤ÇØ¾ß ÇÑ´Ù. ¿©±â¼­ Æнº¿öµå´Â ½Ã½ºÅ۷α×ÀÎ Æнº¿öµå¿Í´Â
´Þ¶ó¾ß ÇÒ °ÍÀÌ´Ù.(¹°·Ð °°¾Æ¼­ ¾ÈµÉ¹ýÀº ¾øÁö¸¸, º¸¾ÈÀº ±×·¸Áö ¾Ê´Ù)
mysql> create database user1;
mysql> create database user2;
mysql> create database user3;


mysql> create database user1;
Query OK, 1 row affected (0.01 sec)
mysql> create database user2;
Query OK, 1 row affected (0.01 sec)
mysql> create database user3;
Query OK, 1 row affected (0.01 sec)

mysql> show databases;
+-----------+
| Database |
+-----------+
| mysql |
| test |
| user1 |
| user2 |
| user3 |
+-----------+
5 rows in set (0.00 sec)


¸®´ª½ºÀÇ °æ¿ì µðÆúÆ®·Î ¼³Ä¡ÇÑ °æ¿ì /usr/local/mysql/var/user1 ÀÌ·± ½ÄÀ¸·Î
µð·ºÅ丮°¡ »ý¼ºµÇ´Â°Í °°´Ù. ÀÌ µð·ºÅ丮°¡ µ¥ÀÌŸ º£À̽º °ø°£À¸·Î ÀÌ¿ëµÉ °÷ÀÌ´Ù.

Áï user1 ¶ó´Â µ¥ÀÌŸ º£À̽º °ø°£¿¡ Å×À̺íÀ» »ý¼ºÇÒ °æ¿ì user1 ¶ó´Â
µð·ºÅ丮·Î °ü·ÃµÈ ÆÄÀÏÀÌ »ý¼ºµÇ¸ç µ¥ÀÌŸ°¡ ÀúÀåµÈ´Ù. Æ۹̼ÇÀÌ Á¤ÇØÁ® ÀÖ¾î
¾ÈÀ» »ìÆ캸Áö´Â ¸øÇß´Ù.
±×·¯³ª ¼Ö¶ó¸®½ºÀÇ °æ¿ì´Â Á» ´Þ¶ú´Ù. dataµð·ºÅ丮°¡ varµð·ºÅ丮 ´ë½Å ¾²¿´´Ù.
[superman:/usr/local/mysql]% cd data
[superman:/usr/local/mysql/data]% ls
./ mysql/ superman.err user1/ user3/
../ test/ superman.pid user2/
*******************************************************************
Áß¿äÇÑ tip......
*******************************************************************
MySQL°ú ÁÖ°í ¹Þ´Â °¢Á¾ ³»¿ëÀº /usr/local/mysql/var »óÀÇ È£½ºÆ®¸í.log
ÆÄÀÏ»ó¿¡ ¸ðµÎ ÀúÀåµÈ´Ù. ¸¸ÀÏ µ¿ÀÛ »óŸ¦ ¾Ë°í ½Í´Ù¸é Å͹̳¯À» Çϳª ´õ
¿­¾î¼­ tail -f È£½ºÆ®¸í.log ÇÏ¿© MySQL°úÀÇ ÁÖ°í¹Þ´Â ³»¿ëÀ»
¸ð´ÏÅ͸µ ÇÒ ¼ö ÀÖ´Ù. ---- ¹Ú¼øÇà(soonhg)´ÔÀÇ °­ÀÇ·ÏÁß¿¡¼­
*******************************************************************

ÀÌ·¯¸é ´Ù µÇ´Â°¡? ¾Æ´Ï´Ù. ÀÌÁ¦ °¢°¢ÀÇ È£¿¡ À̸§À» Áö¾úÀ» »Ó ÀÔÁÖ±ÇÀº ÁÖ¾îÁöÁö
¾Ê¾Ò´Ù.
±ÇÇÑÀÖ´Â »ç¿ëÀÚ°¡ ÀÌ ÁýÀ» »ç¿ëÇϵµ·Ï °¢°¢ÀÇ È£¿¡ ¿­¼è¿Í »ç¿ë±ÔÄ¢À» Á¤ÇØÁÖ¾î¾ß
ÇÑ´Ù.
±×·¸Áö ¾ÊÀ¸¸é, ÀÌ ÁýÀº ¾Æ¹«µµ Á¢±ÙÇÒ ¼ö ¾ø´Â ¹ö·ÁÁø °ø°£ÀÌ µÇ°í ¸¸´Ù.

user¿ë DB¿Í mysql °ü¸®Å×À̺í°úÀÇ Link, »ç¿ëÀÚµî·Ï ¹× °¢°¢ÀÇ ±ÇÇѼ³Á¤ÀÌ ÀÌ·ç¾îÁ®
¾ß
ÇÑ´Ù. ÀÌ°ÍÀÌ ¹Ù·Î ½ÇÁ¦ÀûÀÎ ºÐ¾çÀÌ µÇ´Â ¼ÀÀÌ´Ù.
ÀÚ ÀÌÁ¦ »ý¼ºµÈ µ¥ÀÌŸº£À̽º¿Í µ¥ÀÌŸº£À̽º °ü¸®¹× ¿¢¼¼½º ±ÇÇѵîÀ» Á¤ÀÇ
ÇÏ°í ÀÖ´Â mysql »óÀÇ db, user Å×ÀÌºí¿¡ ¹æ±Ý »ý¼ºµÈ user1,user2,user3
Database ³»¿ëÀ» Á¤ÀÇ ÇÏÀÚ.

mysql> insert into db
-> (host,db,user,select_priv,insert_priv,update_priv
-> ,delete_priv,create_priv,drop_priv,grant_priv,
-> references_priv,index_priv,alter_priv)
-> values ('%','user1','daepal',
-> 'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y')
-> ;
Query OK, 1 row affected (0.01 sec)

À§ÀÇ ³»¿ëÀº ´«°¨µµ ÂøÂø ¸¸µé¾î³½ °ÍÀº ¾Æ´Ï´Ù.
mysql> desc db; ¶ó´Â ¸í·É¾î¸¦ »ç¿ëÇÏ°Ô µÇ¸é, dbÅ×À̺íÀÇ ±¸Á¶°¡ ÀÖÀ¸´Ï ±×°ÍÀ» Âü
Á¶Çؾß
ÇÑ´Ù. insert ½Ã¿¡ öÀÚ°¡ Ʋ·Á¼­µµ ¾ÈµÇ¸ç, Çʵå¼ýÀÚ¿¡ ¸Âµµ·Ï °ªÀ» Á¤È®È÷ ±âÀçÇØ
¾ß ÇÑ´Ù.
À§ÀÇ sql¹®¿¡¼­ º¸¸é daepal À̶ó´Â »ç¿ëÀÚ´Â user1 µ¥ÀÌŸº£À̽º¿¡ ´ëÇÏ¿©
select,insert,update,delete,create,drop,grant,references,index,alter
±ÇÇÑÀÌ ¸ðµÎ ÁÖ¾îÁ³´Ù.
ÀÌ°ÍÀº ÇϳªÀÇ user1 µ¥ÀÌŸ º£À̽º¿¡ ´ëÇÏ¿© °¢ sql ¸í·É¿¡ ´ëÇÑ ±ÇÇÑÀ» °³º°Àû
À¸·Î ÁÙ¼ö ÀÖ´Ù´Â °ÍÀ» ÀǹÌÇÑ´Ù.

ÀÚ ÀÌÁ¦ user1 À̶ó´Â db »ç¿ëÀÚ¿¡ ´ëÇÑ µî·ÏÀ» ÇÒ Â÷·ÊÀÌ´Ù.
´ÙÀ½°ú °°Àº sql ¹®À» ¸¸µé¾î ½ÇÇàÇÑ´Ù.
´ÙÀ½Àº userÅ×ÀÌºí¿¡ »ç¿ëÀÚ¿¡ ´ëÇÑ Á¤º¸¸¦ ±â¼úÇØ ÁÖ¾î¾ß ÇÑ´Ù.
´ÙÀ½Ã³·³ userÅ×À̺íÀÇ ±¸Á¶¸¦ ¹«½ÃÇÏ°í Á¦¸Ú´ë·Î passwd¶ó°í ±â¼úÇÏ¸é ¿¡·¯¿¡ ºÀÂø
ÇÑ´Ù.
¿¡·¯¸¦ ¸¸³ª±â ¿øÇÏÁö ¾ÊÀ¸¸é, ¹Ýµå½Ã desc user; ¸í·ÉÀ¸·Î Å×À̺íÀÇ ±¸Á¶¸¦ º¸¸é¼­
ÇϳªÇϳª °ªÀ» ¸Þ¿ö°¡¸é µÉ °ÍÀÌ´Ù.

mysql> insert into user
-> (host,user,passwd)
-> values ('localhost','user1',passwd('daepal'))
-> ;
ERROR 1064: You have an error in your SQL syntax near '('daepal'))
;' at line 3

mysql> insert into user
-> (host,user,password)
-> values ('localhost','daepal',password('daepal'))
-> ;
Query OK, 1 row affected (0.00 sec)


mysql> desc user;
+-----------------+---------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------------+---------------+------+-----+---------+-------+
| Host | char(60) | | PRI | | |
| User | char(16) | | PRI | | |
| password | char(16) | | | | |
| Select_priv | enum('N','Y') | | | N | |
| Insert_priv | enum('N','Y') | | | N | |
| Update_priv | enum('N','Y') | | | N | |
| Delete_priv | enum('N','Y') | | | N | |
| Create_priv | enum('N','Y') | | | N | |
| Drop_priv | enum('N','Y') | | | N | |
| Reload_priv | enum('N','Y') | | | N | |
| Shutdown_priv | enum('N','Y') | | | N | |
| Process_priv | enum('N','Y') | | | N | |
| File_priv | enum('N','Y') | | | N | |
| Grant_priv | enum('N','Y') | | | N | |
| References_priv | enum('N','Y') | | | N | |
| Index_priv | enum('N','Y') | | | N | |
| Alter_priv | enum('N','Y') | | | N | |
+-----------------+---------------+------+-----+---------+-------+
17 rows in set (0.00 sec)

»ý·«ÇÑ Ç׸ñ(Çʵå)¿Í °ªÀº À§¿¡¼­ º¸µíÀÌ ±âº»°ªÀÌ 'N'ÀÓÀ» »ó±âÇØ¾ß ÇÑ´Ù.

host,user,password¿ÜÀÇ Ä®·³µéÀº ¸ðµÎ µðÆúÆ®·Î 'N' À¸·Î ¼³Á¤
µÇ¾î ÀÖÀ¸¹Ç·Î À§¿Í °°ÀÌ ÇϸéµÈ´Ù. ¿©±â¼­ db Å×À̺í°ú user Å×À̺íÀº
Ư±Ç»ó¿¡¼­ ¾à°£ÀÇ Â÷ÀÌÁ¡ÀÌ ÀÖ´Ù. db Å×ÀÌºí »ó¿¡¼­ ¼³Á¤µÇÁö ¾Ê°í
user Å×ÀÌºí »ó¿¡¸¸ ¼³Á¤µÇ¾îÁø DB »ç¿ëÀÚ´Â user Å×ÀÌºí »ó¿¡¼­ ¼³Á¤
µÈ ±ÇÇÑÀ» Á¸ÀçÇÏ´Â ¸ðµç µ¥ÀÌŸº£À̽º¿¡ ´ëÇÏ¿© ÀÎÁ¤¹Þ´Â´Ù.

ÀÌ·¯ÇÑ ÀÌÀ¯·Î ÀϹݻç¿ëÀÚÀÎ °æ¿ì´Â user Å×ÀÌºí »ó¿¡´Â ¸ðµç ±ÇÇÑÀ»
'N' ·Î ¼³Á¤ÇÏ¿©¾ß ÇÏ°í °¢ DB user °¡ »ç¿ëÇÒ µ¥ÀÌŸº£À̽º¿¡ ´ëÇÑ
±ÇÇÑÀ» DB Å×ÀÌºí¿¡ ´Ù½Ã Á¤ÇØÁÖ´Â °ÍÀÌ´Ù.
Áï, µ¥ÀÌŸº£À̽º°¡ ¿©·¯°³ Á¸ÀçÇÑ´Ù°í °¡Á¤ÇÏÀÚ. aaa,bbb, ccc ¶ó´Â
¼¼°³ÀÇ µ¥ÀÌŸº£À̽º°¡ Á¸ÀçÇÒ¶§, daepalÀ̶ó´Â »ç¿ëÀÚ´Â aaa ¶ó´Â
µ¥ÀÌŸº£À̽º¸¸ ÀÌ¿ëÇÏ°Ô ÇÏ·Á°í ¼³Á¤ÇÏ·Á°í ÇÑ´Ù°í ÇÏÀÚ.

ÀÌ°æ¿ì´Â user Å×ÀÌºí¿¡´Â ¸ðµç ±ÇÇÑÀ» 'N' »óÅ·Π¼³Á¤ÇÏ°í db Å×À̺í
¿¡´Â aaa ¶ó´Â µ¥ÀÌÅͺ£À̽º¿¡ ´ëÇÏ¿© ¸ðµç ±ÇÇÑÀ» 'Y' ¶ó°í ¼³Á¤Çϸé
daepalÀ̶ó´Â »ç¿ëÀÚ´Â aaa ¶ó´Â µ¥ÀÌŸº£À̽º¿¡ ´ëÇÏ¿© »ç¿ë±ÇÇÑÀ»
È®º¸ÇÏ°Ô µÉ °ÍÀÌ´Ù.

*******************************************************************
Áß¿äÇÑ tip......
*******************************************************************
user Å×ÀÌºí¿¡ »ç¿ëÀÚ¸¦ insert, update ÇÑ °æ¿ì MySQLÀ» ²À Àç±âµ¿
½ÃÄÑ ÁÖ¾î¾ß¸¸ ÇÑ´Ù. ¸í·ÉÀº ´ÙÀ½°ú °°´Ù.
myaqladmin -u root -p reload
ÀÌ ¸í·ÉÀº user Å×ÀÌºí¿¡¼­ »ç¿ëÀÚ Á¤º¸¸¦ ´Ù½Ã Àо MySQL À» ´Ù½Ã
½ÇÇà½ÃÄÑÁØ´Ù. ---- ¹Ú¼øÇà(soonhg)´ÔÀÇ °­ÀÇ·ÏÁß¿¡¼­
*******************************************************************
[superman:/usr/local/mysql/data]% mysql -udaepal -pdaepal user1
ERROR 1045: Access denied for user: 'daepal@localhost' (Using password: YES)

[superman:/usr/local/mysql/data]% mysqladmin -uroot reload
[superman:/usr/local/mysql/data]% mysql -udaepal -pdaepal user1
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 58 to server version: 3.22.24

Type 'help' for help.

mysql> show tables;
Empty set (0.01 sec)

mysql>


;
;
;
;
;
;
;
ÀÚ À̷νá rootµÈ ÀÚÀÇ µµ¸®´Â ¾î´ÀÁ¤µµ ¸¶¹«¸®°¡ µÇ¾ú´Ù.
¾ÆÆÄÆ®µµ ºÐ¾çÀÌ µÇ¾ú°í, ¿­¼èµµ Á־ ¾ðÁ¦µçÁö ÀÔÁÖÇÒ ¼ö ÀÖµµ·Ï ¸ðµç Áغñ¸¦ ³¡
³Â´Ù.
ÀÌÁ¦ »ç¿ëÀÚ¿¡°Ô µ¥ÀÌÅͺ£À̽ºÀÇ À̸§°ú ·Î±×ÀÎ¸í ±×¸®°í ºñ¹Ð¹øÈ£¸¦ ÀüÇØÁÖ¸é,
rootµÈ ÀÚÀÇ ÈǸ¢ÇÑ ÀÓ¹«¸¦ ¿Ï¼öÇÏ°Ô µÇ´Â °ÍÀÌ´Ù. root¸¸¼¼...

ÀÚ ÀÌÁ¦´Â userµÈ ÀÚÀÇ µµ¸®¸¦ ´ÙÇØ, root´Ô²²¼­ ºÐ¾çÁֽŠÁýÀ» Àß °ü¸®ÇØ º¸ÀÚ..
DB¸¦ ¾ò°Ô µÇ¸é ±×¾È¿¡ Å×À̺íÀ̶ó ºÒ¸®¿ì´Â ³à¼®À» ¸¸µé¼ö°¡ ÀÖ´Ù.
½ÇÁ¦·Î ¿ì¸®°¡ DB¿¡ Äõ¸®(ÁúÀÇ)¸¦ ³¯¸®´Ù°í ¸»À» Çϴµ¥, ¹Ù·Î À̳༮(Å×À̺í)ÀÌ
¹Ù·Î ±× ´ë»óÀÎ ¼ÀÀÌ´Ù. ±×·¯´Ï±î, DBÀÇ ¹«°á¼º°ú ¿Ïº®¼ºÀº ¹Ù·Î ¾ó¸¶³ª Å×À̺íÀ»
Àß ¸¸µé°í °ü¸®ÇÏ´À³Ä¿¡ µû¶ó »çÁ¤ÀÌ È®¿¬È÷ ´Þ¶óÁø´Ù. Å×À̺íÀÌ È¥ÀÚ ³î¼öµµ ÀÖÁö¸¸
,
¾ÆÁÖ ºñ½Ñ ÄÄÆ÷³ÍÆ® ¿Àµð¿Àó·³ ¿©·¯°¡Áö ¿¬°á¼±À» ÅëÇØ Çϳª·Î µ¿ÀÛÇÏ´Â °æ¿ìµµ ÀÖ
´Ù.
Å×ÀÌºí°£ÀÇ °ü°è(Á¶ÀÎ)·Î ÀÌ·ç¾îÁø DB´Â ¸Å¿ì º¹ÀâÇÑ ÀÏ¿¡ ¾²ÀÌ°Ô µÈ´Ù.
°ü°èÇüµ¥ÀÌÅͺ£À̽º¶ó ºÒ¸®¿ì´Â ÀÌÀ¯´Â ¹Ù·Î ¿©±â¿¡ ÀÖ´Ù. ÀڷᱸÁ¶µéÀÌ ¼­·Î °ü°è¸¦

¸Î°í ÀÖÀ¸¸é¼­ »óÈ£ÀÛ¿ëÀ» Çϱ⠶§¹®ÀÌ´Ù. µ¥ÀÌÅͺ£À̽º µðÀÚÀÎÀÌ Áß¿äÇÑ ¹®Á¦·Î ¶°
¿À¸£´Â
°ÍÀº ÀÌ·¯ÇÑ °ü°è°¡ óÀ½¿¡ À߸ø ¼³Á¤ÀÌ µÇ¸é, ¾ÖÇø®ÄÉÀÌ¼Ç Àüü¸¦ óÀ½ºÎÅÍ ´Ù½Ã
ÇÁ·Î±×·¡¹ÖÀ» ÇؾßÇÏ´Â ¾îó±¸´Ï ¾ø´Â »çÅ¿¡ ´Ù´Ù¸£°Ô µÇ±â ¶§¹®ÀÌ´Ù. ÀÌ°ÍÀº ³ªµµ
µÎ¾î¹ø °æÇèÀ» Çؼ­ ¸Å¿ì Áß¿ä½ÃÇÏ°í Á¶½É½º·¯¿ö ÇÏ´Â ºÎºÐÀÌ´Ù.
ÇÏÁö¸¸ ¿©±â¼±´Â userµÈÀÚÀÇ ±âº»µµ¸®ÀÎ Å×À̺íÇϳª¸¸ ¸¸µé¾î º¸´Â °ÍÀ¸·Î ¸¸Á·ÇÑ´Ù.

±× ÀÌ»óÀº Àڽŵµ ¾ø°Å´Ï¿Í µ¶¸³ÀûÀÎ ¹üÁÖ·Î ´Ù·ç¾î¾ß ÇÒ ÁÖÁ¦¶ó »ý°¢µÇ±â ¶§¹®ÀÌ´Ù.


% mysql -udaepal -pdaepal user1

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 58 to server version: 3.22.24

Type 'help' for help.

mysql> show tables;
Empty set (0.01 sec)

mysql>


¾Æ¹«°Íµµ ¾ø´Â ²®µ¥±â¿¡ ÀÌÁ¦ userµÈ ÀÚÀÇ µµ¸®¸¦ ´ÙÇØ
½Ç³»Àå½Ä¿¡ °ÔÀ¸¸§À» ÇÇ¿ö¼± ¾ÈµÈ´Ù. ÀÌÁ¦ À̻縦 ¿Í¼­ º¸¾Ò´õ´Ï º®¿¡ º®Áöµµ
ºÙ¾îÀÖÁö ¾Ê´Â ÁýÀ» »ó»óÇØ º¸ÀÚ... Empty set ... ¹Ù·Î ÀÌ·± °ÝÀÌ´Ù.
ÀÌÁ¦ Å×À̺íÀ» ÇϳªµÑ µé¿©³õ¾Æ¾ß ÇÑ´Ù. ±×·¡¾ß Àáµµ ÀÚ°í »ì¸²µµ ÇÏ°í ±×·²Å״ϱî..
..

mysql> create table individual
-> (
-> pno char(13) primary key,
-> name char(20) not null,
-> addr char(80),
-> tel char(15)
-> )
-> ;
Query OK, 0 rows affected (0.01 sec)

mysql> show tables;
+-----------------+
| Tables in user1 |
+-----------------+
| individual |
+-----------------+
1 row in set (0.00 sec)

mysql> select * from individual;
Empty set (0.01 sec)

Å×ÀÌºí¸¸ ¸¸µé¸é µÇ´Â°¡?
´ç¿¬È÷ Å×À̺íÀÇ ³»¿ë¹°À» ä¿ö¾ß ÇÑ´Ù.
Âü°í·Î primary key(ÁÖÅ°)¶ó´Â °ÍÀº ÇϳªÀÇ Å×À̺íÀÌ ÀÚ½ÅÀÇ ÁÖü¼ºÀ» È®º¸Çϱâ À§ÇØ

-µ¥ÀÌÅÍÀÇ ¹«°á¼ºÀ̶ó°í ÇÑ´Ù- ¹Ýµå½Ã ÀÖ¾î¾ß ÇÑ´Ù..
ÀÌ°ÍÀÇ Á¸ÀçÀÌÀ¯´Â ¿©·¯°¡Áö°¡ ÀÖÁö¸¸, ´Ù¸¥ Å×À̺í°ú ÀÚ½ÅÀ» ±¸º°Çϱâ À§ÇØ ¾²ÀδÙ
°í
º¸¸é µÈ´Ù. ³ª¸¦ ¼¼°èÀÇ À¯ÀÏÇÑ Á¸Àç·Î ¾Ë¸®´Â °ÍÀº À̸§Àΰ¡?
Never!!! ¶ó°íµé À̾߱â ÇÑ´Ù.
±×´ë½Å ¿ì¸° 740551-1666418 À̶ó´Â ÁֹιøÈ£¸¦ ¾´´Ù. ¹°·Ð À̰͵µ ¼¼°èÀÇ À¯ÀÏÇÑ Á¸
Àç
º¸´Ù´Â ´ëÇѹα¹ÀÇ À¯ÀÏÇÑ Á¸Àç¶ó°í º¸´Â°Ô ³´°Ú´Ù. ÁֹιøÈ£¸¦ µ¶ÀÏ¿¡ °¡¼­ ¾µ »ý°¢
ÀÌ
¾Æ´Ï¶ó¸é.....^^;
±×¸®°í »öÀαâ´É(index)À» °¡Áö°í ÀÖ´Â Çʵå(Ç׸ñ)ÂëÀ¸·Î ±â¾ïÇصθé ÆíÇÒ °ÍÀÌ´Ù.
µ¥ÀÌÅÍ°Ë»ö È¿À²À» ³ôÀ̱â À§ÇØ À妽ÌÀ» ÇÑ´Ù°í ÇÑ´Ù.
µµ¼­°ü¿¡ °¡¼­ Ã¥À» °¡Àå »¡¸® ã´Â ¹æ¹ýÀº ?
À¯ÀÏÇÏÁö´Â ¾ÊÁö¸¸, ´ë°­ ¹æ¹ýÀÌ ÀÖ´Ù. ¹Ù·Î ±×°ÍÀÌ À妽ÌÀÌ´Ù.

mysql> insert into individual
-> values ('740551-1666418','Á¤À¯¸®','Àü³² ¿Ïµµ±º ¼Ò¾È¸é','123-1234')
-> ;
Query OK, 1 row affected (0.00 sec)

mysql> select * from individual;
+---------------+--------+--------------------+----------+
| pno | name | addr | tel |
+---------------+--------+--------------------+----------+
| 740551-166641 | Á¤À¯¸® | Àü³² ¿Ïµµ±º ¼Ò¾È¸é | 123-1234 |
+---------------+--------+--------------------+----------+
1 row in set (0.00 sec)
;
;
;
¿©±â±îÁö 4½Ã°£¿¡ °ÉÃÄ Á¶±ÝÀº Áö·çÇÑ °¨ÀÌ ÀÖ¾úÁö¸¸, ¾ÆÁÖ º¸¶÷µÇ°Ô ½Ç½ÀÀ» ÇØ º¸¾Ò
½À´Ï´Ù.
¹°·Ð ÀÌ ½Ç½ÀÀº ³ª¸¦ À§ÇÑ °ÍÀÇ ¼º°ÝÀÌ °­ÇßÀ¸¸ç, ´Ù¸¥ »ç¶÷µµ ÀоîÁØ´Ù¸é ±â»ÝÀÌ µÎ
¹è·Î
Áõ°¡µÉ °Í °°½À´Ï´Ù. À̱ÛÀº Àü¹ÝÀûÀ¸·Î º¸¾Æ ÇÏÀÌÅÚ¸®´ª½º µ¿È¸È¸ÀÇ ¹Ú¼øÇà(soonhg)
´ÔÀÇ
±ÛÀ» Á¦°¡ ¾à°£ÀÇ »ìÀ» ºÙ¿© ÀÛ¼ºÇÑ °ÍÀ¸·Î ÀÚÀÛ¹°ÀÌ ¾Æ´ÔÀ» ¹àÇôµÓ´Ï´Ù.
¿À´Ã À̱ÛÀº ÇÏÀÌÅÚ¸®´ª½ºµ¿È£È¸ ȸ¿øµé¿¡°Ô ¹ÙÄ¡°í ½Í½À´Ï´Ù.

°ü·Ã±Û : ¾øÀ½ ±Û¾´½Ã°£ : 2002/10/23 14:09 from 218.154.16.35

  Temporary TablespaceÀÇ º¹±¸ ¸ñ·Ïº¸±â »õ±Û ¾²±â Áö¿ì±â ÀÀ´ä±Û ¾²±â ±Û ¼öÁ¤ mysql ¸Þ´º¾ó1  
BACKRUSH  À¯´Ð½º¸í·É  ´ÙÀ½  ÀÚ·á½Ç  Ascii Table   ¿ø°ÝÁ¢¼Ó  ´Þ·Â,½Ã°£   ÇÁ·Î¼¼½º   ½©
ÁöÇÏö³ë¼±   RFC¹®¼­   SUN FAQ   SUN FAQ1   C¸Þ´º¾ó   PHP¸Þ´º¾ó   ³Ê±¸¸®   ¾Æ½ºÅ°¿ùµå ¾ÆÀÌÇǼ­Ä¡