재밌고 어려운 IT를 이해해보자~!
MySQL 설치 본문
https://blog.naver.com/coding_helper/222632830115
https://blog.naver.com/coding_helper/222632837868
mysql> SHOW DATABASES;
+--------------------+
| Database |
+--------------------+
| information_schema |
| kimdb |
| mysql |
| performance_schema |
| spring |
| sys |
+--------------------+
6 rows in set (0.00 sec)
mysql> USE KIMDB;
Database changed
mysql> SHOW TABLES;
Empty set (0.00 sec)
mysql> CREATE TABLE MEMBER(
-> MID VARCHAR(10) PRIMARY KEY,
-> PASSWORD VARCHAR(10) NOT NULL,
-> NAME VARCHAR(20) NOT NULL,
-> ROLE VARCHAR(10) NOT NULL
-> );
Query OK, 0 rows affected (0.02 sec)
mysql> SHOW TABLES;
+-----------------+
| Tables_in_kimdb |
+-----------------+
| member |
+-----------------+
1 row in set (0.00 sec)
mysql> CREATE TABLE BOARD(
-> BID INT PRIMARY KEY AUTO_INCREMENT,\
->
-> _'
'>
'> );;
'>
'>
'> ;
'> ;;
'> EXIT
'>
'> ^C
mysql> ^C
mysql> ^C
mysql>
mysql>
mysql>
mysql> CREATE TABLE BOARD(
-> BID INT PRIMARY KEY AUTO_INCREMENT,
-> TITLE VARCHAR(30) NOT NULL,
-> CONTENT VARCHAR(30) NOT NULL,
-> WRITER VARCHAR(10) NOT NULL
-> );
Query OK, 0 rows affected (0.01 sec)
mysql> INSERT INTO MEMBER VALUES('
'> ^X^C
mysql> ^C
mysql> INSERT INTO MEMBER VALUES('test','1234','테스트','USER');
Query OK, 1 row affected (0.01 sec)
mysql> INSERT INTO MEMBER VALUES('admin','1234','관리자','ADMIN');
Query OK, 1 row affected (0.00 sec)
mysql> SHOW TABLES;
+-----------------+
| Tables_in_kimdb |
+-----------------+
| board |
| member |
+-----------------+
2 rows in set (0.00 sec)
mysql> SELECT * FROM MEMBER;
+-------+----------+--------+-------+
| MID | PASSWORD | NAME | ROLE |
+-------+----------+--------+-------+
| admin | 1234 | 관리자 | ADMIN |
| test | 1234 | 테스트 | USER |
+-------+----------+--------+-------+
2 rows in set (0.00 sec)
mysql> INSERT INTO BOARD VALUES(1001,'제목','내용','test');
Query OK, 1 row affected (0.00 sec)
mysql> INSERT INTO BOARD (TITLE,CONTENT,WRITER) VALUES('제목22','내용22','test');
Query OK, 1 row affected (0.00 sec)
mysql> SELECT * FROM BOARD;
+------+--------+---------+--------+
| BID | TITLE | CONTENT | WRITER |
+------+--------+---------+--------+
| 1001 | 제목 | 내용 | test |
| 1002 | 제목22 | 내용22 | test |
+------+--------+---------+--------+
2 rows in set (0.00 sec)
mysql>
'코리아IT핀테크과정' 카테고리의 다른 글
Lombok (0) | 2024.03.12 |
---|---|
@PathVariable, 다양한 Ctrl 메서드 (0) | 2024.03.11 |
Command 객체 (2) | 2024.03.07 |
Spring 궁금증 정리 (0) | 2024.03.06 |
Spring 프레임워크 구조 Update (버전별 정리) (0) | 2024.03.05 |
Comments