Server/MySQL 2018.02.27 19:04

MySQL- 3. MySQL 테이블 생성 및 삭제

 

 

 

1. 테이블 생성

 

msfadmin@metasploitable:~$ mysql -h 192.168.20.204 -u ccna1234 -p1234
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 19
Server version: 5.0.51a-3ubuntu5 (Ubuntu)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

 

mysql> use cisco;
Database changed

 

 

mysql> show tables;
Empty set (0.00 sec)

 

 

mysql> create table ccna (UserID varchar(20), UserPass varchar(20), UserNAME varchar(20), age int);
Query OK, 0 rows affected (0.00 sec)

 

 

mysql> create table ccnp (UserID varchar(20), UserPass varchar(20), UserNAME varchar(20), age int);
Query OK, 0 rows affected (0.01 sec)

 

 

mysql> create table ccie (UserID varchar(20), UserPass varchar(20), UserNAME varchar(20), age int);
Query OK, 0 rows affected (0.00 sec)

 

 

mysql> create table ccde (UserID varchar(20), UserPass varchar(20), UserNAME varchar(20), age int);
Query OK, 0 rows affected (0.00 sec)

 


mysql> show tables;
+-----------------+
| Tables_in_cisco |
+-----------------+
| ccde            |
| ccie            |
| ccna            |
| ccnp            |
+-----------------+
4 rows in set (0.00 sec)

 

 

2. Type

 

표 제작중

 

 

 


3. 테이블 삭제

 

mysql> drop table ccde;
Query OK, 0 rows affected (0.00 sec)

 

 

mysql> show tables;
+-----------------+
| Tables_in_cisco |
+-----------------+
| ccie            |
| ccna            |
| ccnp            |
+-----------------+
3 rows in set (0.00 sec)

Posted by 교육 문의 : 010-9902-9710(김정우 강사)


Q