+++ ȨÁ¦ÀÛ ¹ÙÀ̺í +++
ȨÁ¦ÀÛ ¹ÙÀ̺í ÀÌ »çÀÌÆ®´Â ÀÌ¿µÂù´ÔÀÇ »çÀÌÆ®¸¦ º¹¿øÇÑ °ÍÀÔ´Ï´Ù.
Untitled Document
Html
Dhtml
Css
Php
Asp
Cgi
Java Script
Java Applet
Multimedia
Win Tip
Mysql ¼³Ä¡Çϱâ
¸ñÇ¥: MySQL  ¹ÙÀ̳ʸ® ¹èÆ÷º»À» /usr/local/mysql ¿¡ ¼³Ä¡Çϱâ.

1. http://www.mysql.com/ ¿¡ ¹æ¹®ÇÏ¿© ÃֽŹöÀüÀÇ MySQL ¹ÙÀ̳ʸ® ¹öÀüÀ» ´Ù¿î ¹Þ½À´Ï´Ù.

È­ÀϸíÀº mysql_¹öÀü_¿î¿µÃ¼Á¦_tar.gzÀÔ´Ï´Ù.

¿¹) mysql-3_21_33c-pc-linux-gnu-i686_tar.gz


2. ´Ù¿î ¹ÞÀº È­ÀÏÀ» FTP¸¦ ÀÌ¿ë ¿©·¯ºÐÀÇ ¼­¹ö /tmp ¿¡ ¿Å°Ü ³õ±¸¿ä (Àӽ÷ΠÀúÀåÇÏ´Â °ÍÀ̹ǷΠ´ç½ÅÀÌ ¿øÇÏ´Â ¾Æ¹« µð·ºÅ丮µµ »ó°ü¾ø½À´Ï´Ù.)


3. È®ÀÎ. (È­ÀÏÅ©±â´Â Á» ´Ù¸¦ ¼öµµ ÀÖÀ½)

[/tmp]# ls -al my*
-rw-r--r--   1 root     root      3000463 Jan 25 15:26 mysql-3_21_33c-pc-linux-gnu-i686_tar.gz


4. ¾ÐÃàÇ®±â

[/tmp]# zcat mysql-3_21_33c-pc-linux-gnu-i686_tar.gz  | tar xvf -


5. Ç®¸°°ÍÀ» /usr/local/mysql ·Î À̵¿½ÃÅ°±â

[/tmp]# mv ./mysql-3.21.33c-pc-linux-gnu-i686/ /usr/local/mysql/


6. /usr/local/mysql ·Î À̵¿

[/tmp]# cd /usr/local/mysql/


7. /scripts/mysql_install_db ½ÇÇà

ÇÑ°¡Áö ÁÖÀÇ ÇϽÇÁ¡Àº ¹Ýµå½Ã /usr/local/mysql ¿¡¼­ ½ÇÇàÀ» ÇØ¾ß ÇÑ´Ù´Â °Ì´Ï´Ù. ¾Æ·¡ÀÇ ¸Þ½ÃÁö°¡ ³ª¿À¸é ¼º°øÀûÀ¸·Î ¼³Ä¡°¡ µÈ °Ì´Ï´Ù.

[mysql]# ./scripts/mysql_install_db
Starting mysql server
Starting mysqld demon with databases from /usr/local/mysql/data
mysqld demon is running and mysql grant tables are installed.

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !

You can test the MySQL demon with the benchmarks in the 'bench'
directory:
cd bench ; run-all-tests

You can also try the mysql command line tool with:
./bin/mysql test

Plese report any problems with the ./bin/mysqlbug script!
The latest information about MySQL is available on the web at http://www.tcx.se

Have fun and at least consider supporting MySQL if you find it useful :)



8. MySQL µ¥¸ó È®ÀÎ.

[mysql]# ps -x | grep mysql


9. »ç¿ëÀÚ ÀÎÁõ Å×À̺íÀ» ¼öÁ¤

bin µð·ºÅ丮 ¹ØÀÇ sql clientÀÎ mysql À» ÀÌ¿ëÇؼ­ mysql µ¥ÀÌŸ º£À̽º¸¦ »ç¿ë´Ï´Ù.

»ç¿ë¹æ¹ý :  ./bin/mysql [OPTIONS] [database]

[mysql]# ./bin/mysql mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4 to server version: 3.21.33c-log

Type 'help' for help.
mysql>



10. Å×À̺íÈ®ÀÎ(¹öÀü¿¡ µû¶ó ´õ ÀÖÀ» ¼öµµ ÀÖÀ½)

mysql> show tables ;
+-----------------+
| Tables in mysql |
+-----------------+
| db              |
| func            |
| host            |
| user            |
+-----------------+

4 rows in set (0.00 sec)




11. user Å×ÀÌºí ±¸Á¶¸¦ È®ÀÎ(¹öÀü¿¡ µû¶ó ´Ù¸¦ ¼öµµ ÀÖÀ½)

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       |       |
+---------------+---------------+------+-----+---------+-------+

13 rows in set (0.01 sec)



12. user Å×À̺íÀÇ »ç¿ëÀÚ¸¦ È®ÀÎ.

mysql> select * from user ;


13. ÀÌÁ¦ user ¶ó´Â Å×ÀÌºí¿¡ »õ·Î¿î »ç¿ëÀÚ mysql À» Ãß°¡ÇÏ°í È®ÀÎÇØ º¸¼¼¿ä. ¿ª±â¼­ Ãß°¡ÇÏ´Â »ç¿ëÀÚ´Â ½Ã½ºÅÛ »ç¿ëÀÚ¿Í´Â ÀüÇô °ü°è¾ø´Â DB »ç¿ëÀÚ ÀÔ´Ï´Ù.(¹öÀü¿¡ µû¶ó 'Y'¸¦ 14°³ ³Ö¾î¾ß µÇ´Â °æ¿ìµµ ÀÖ½À´Ï´Ù)

mysql> insert into user values('localhost','mysql',password('abcd'),'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y');

Query OK, 1 row affected (0.01 sec)

mysql> select * from user ;


14. ÀÌÁ¦´Â ²À! mysql µ¥¸óÀ» ´Ù½Ã ¶ç¿ö¾ß »õ·Î¿î MySQL À¯Àú mysqlÀÌ »ç¿ë °¡´ÉÇÕ´Ï´Ù.

mysql> \q
Bye
[mysql]# ./bin/mysqladmin reload
[mysql]#

15. »õ·Î µî·ÏµÈ »ç¿ëÀÚ mysql·Î test DB¸¦ »ç¿ëÇϱâ

»ç¿ë¹ý :  mysql -u»ç¿ëÀÚ -p¾ÏÈ£ DBÀ̸§

[mysql]# ./bin/mysql -umysql -pabcd test
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 17 to server version: 3.21.33c-log

Type 'help' for help.


mysql> create table table01 ( id int , name char(10) ) ;
       
Query OK, 0 rows affected (0.09 sec)

mysql> insert into table01 values(1,'ÀÌ¿µÂù');
Query OK, 1 row affected (0.03 sec)

mysql> select * from table01 ;
+------+--------+
| id   | name   |
+------+--------+
|    1 | È«±æµ¿ |
+------+--------+

1 row in set (0.01 sec)

mysql>

16. MySQL µ¥¸óÀ» ¶ç¿ì´Â ¹æ¹ýÀº ´ÙÀ½°ú °°½À´Ï´Ù.

ÀÚµ¿À¸·Î ¶ç¿ì°í ½ÍÀ¸¸é /etc/rc.d/rc.local È­ÀÏ¿¡ ¾Æ·¡ºÎºÐÀ» Ãß°¡ ÇÏ¸é µË´Ï´Ù.

# cd /usr/local/mysql
# ./bin/safe_mysqld &


17. À§ÀÇ °úÁ¤ÀÌ Á¤»óÀûÀ¸·Î µÇ¸é ¼³Ä¡¼º°ø!
Update : 2000/04/27 [µ¹¾Æ°¡±â]