mysql> show databases;
- 현제 생성된 데이터 베이스 보기
+----------+
| Database |
+----------+
| mysql |
+----------+
1 row in set (0.00 sec)
mysql> create database test; - test 라는 데이터 베이스 생성
Query OK, 1 row affected (0.01 sec)
mysql> show databases;
+----------+
| Database |
+----------+
| mysql |
| test |
+----------+
2 rows in set (0.00 sec)
mysql> use test; - test 데이터 베이스를 사용함
Database changed
mysql> create table saram(id char(10), name char(20), age int);
- test 데이터 베이스에 saram 이라는 테이블 생성
Query OK, 0 rows affected (0.04 sec)
mysql> describe saram; - 테이블의 목록을 본다
+-------+----------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+----------+------+-----+---------+-------+
| id | char(10) | YES | | NULL | |
| name | char(20) | YES | | NULL | |
| age | int(11) | YES | | NULL | |
+-------+----------+------+-----+---------+-------+
3 rows in set (0.02 sec)
mysql> desc saram; - 목록 보기의 다른 명령어
+-------+----------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+----------+------+-----+---------+-------+
| id | char(10) | YES | | NULL | |
| name | char(20) | YES | | NULL | |
| age | int(11) | YES | | NULL | |
+-------+----------+------+-----+---------+-------+
3 rows in set (0.01 sec)
mysql> insert into saram(id, name, age) values('aaa','gildong', 32);
- 생성된 테이블에 정보를 넣는 구문
Query OK, 1 row affected (0.02 sec)
mysql> select * from saram; - 테이블의 내용 보기
+------+---------+------+
| id | name | age |
+------+---------+------+
| aaa | gildong | 32 |
+------+---------+------+
1 row in set (0.00 sec)
mysql> select name, age from saram; - 테이블의 내용중 원하는 부분만 보기
+---------+------+
| name | age |
+---------+------+
| gildong | 32 |
+---------+------+
1 row in set (0.01 sec)
mysql> insert into saram values('bbb','sunshin',400); - 데이터를 넣는 다른 유형
Query OK, 1 row affected (0.01 sec)
mysql> insert into saram values('ccc','ginea',20);
Query OK, 1 row affected (0.01 sec)
mysql> select * from saram;
+------+---------+------+
| id | name | age |
+------+---------+------+
| aaa | gildong | 32 |
| bbb | sunshin | 400 |
| ccc | ginea | 20 |
+------+---------+------+
3 rows in set (0.00 sec)
mysql> update saram set name='jinea' where id='ccc';
- 테이블 내 데이터 수정
* 주의할점 where id 를 넣지않으면 테이블 내에 모든 내용이 바뀐다
Query OK, 1 row affected (0.02 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> select * from saram;
+------+---------+------+
| id | name | age |
+------+---------+------+
| aaa | gildong | 32 |
| bbb | sunshin | 400 |
| ccc | jinea | 20 |
+------+---------+------+
3 rows in set (0.01 sec)
mysql> alter table saram change age nai tinyint;
- 테이블의 목록 이름 및 변수타입을 바꿔주는 명령어
Query OK, 3 rows affected, 1 warning (0.10 sec)
Records: 3 Duplicates: 0 Warnings: 1
mysql> select * from saram;
+------+---------+------+
| id | name | nai | - 목록 이름이 바뀌었다
+------+---------+------+
| aaa | gildong | 32 |
| bbb | sunshin | 127 | - tinyint 의 값이 -128~127 이기 때문에
| ccc | jinea | 20 | 127 초과 값인 400이 127로 바뀐다
+------+---------+------+
3 rows in set (0.00 sec)
mysql> delete from saram where id='ccc';
- 데이터 삭제 여기서도 where id 를 같이 쓰지 않으면 모두 삭제된다
Query OK, 1 row affected (0.00 sec)
mysql> select * from saram;
+------+---------+------+
| id | name | nai |
+------+---------+------+
| aaa | gildong | 32 |
| bbb | sunshin | 127 |
+------+---------+------+
2 rows in set (0.00 sec)
mysql> drop table saram; - 테이블 삭제 명령
Query OK, 0 rows affected (0.01 sec)
mysql> show tables;
Empty set (0.02 sec)
mysql> show databases;
+----------+
| Database |
+----------+
| mysql |
| test |
+----------+
2 rows in set (0.02 sec)
mysql> drop database test; - 데이터베이스 삭제 명령
Query OK, 0 rows affected (0.01 sec)
mysql> show databases;
+----------+
| Database |
+----------+
| mysql |
+----------+
1 row in set (0.00 sec)
mysql>
mysql> set password = password('변경할 패스워드'); - 패스워드변경
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 6430 | 12년 전 | 977 | ||
| 6429 | 12년 전 | 9100 | ||
| 6428 | 12년 전 | 600 | ||
| 6427 |
제이티37
|
12년 전 | 1568 | |
| 6426 |
프로프리랜서
|
12년 전 | 1154 | |
| 6425 |
프로프리랜서
|
12년 전 | 1608 | |
| 6424 |
프로프리랜서
|
12년 전 | 1807 | |
| 6423 | 12년 전 | 1000 | ||
| 6422 |
퍼블리셔지노군
|
12년 전 | 1572 | |
| 6421 | 12년 전 | 2207 | ||
| 6420 |
|
12년 전 | 1334 | |
| 6419 |
|
12년 전 | 1287 | |
| 6418 | 12년 전 | 1181 | ||
| 6417 |
senseme
|
12년 전 | 7418 | |
| 6416 |
senseme
|
12년 전 | 1327 | |
| 6415 |
senseme
|
12년 전 | 1190 | |
| 6414 |
senseme
|
12년 전 | 1967 | |
| 6413 |
senseme
|
12년 전 | 971 | |
| 6412 |
senseme
|
12년 전 | 1489 | |
| 6411 |
senseme
|
12년 전 | 1095 | |
| 6410 |
senseme
|
12년 전 | 1045 | |
| 6409 |
PASKRAN
|
12년 전 | 2818 | |
| 6408 | 12년 전 | 10796 | ||
| 6407 | 12년 전 | 2989 | ||
| 6406 |
프로프리랜서
|
12년 전 | 2828 | |
| 6405 |
프로프리랜서
|
12년 전 | 1370 | |
| 6404 |
프로프리랜서
|
12년 전 | 2723 | |
| 6403 |
프로프리랜서
|
12년 전 | 817 | |
| 6402 |
프로프리랜서
|
12년 전 | 1728 | |
| 6401 |
프로프리랜서
|
12년 전 | 1139 | |
| 6400 |
프로프리랜서
|
12년 전 | 1464 | |
| 6399 |
프로프리랜서
|
12년 전 | 1179 | |
| 6398 |
프로프리랜서
|
12년 전 | 1486 | |
| 6397 |
프로프리랜서
|
12년 전 | 3602 | |
| 6396 | 12년 전 | 1869 | ||
| 6395 | 12년 전 | 920 | ||
| 6394 |
|
12년 전 | 5239 | |
| 6393 |
제이티37
|
12년 전 | 1202 | |
| 6392 |
songsinica
|
12년 전 | 1204 | |
| 6391 |
|
12년 전 | 3380 | |
| 6390 |
|
12년 전 | 1623 | |
| 6389 | 12년 전 | 4855 | ||
| 6388 |
스누피사랑
|
12년 전 | 5431 | |
| 6387 | 12년 전 | 1838 | ||
| 6386 | 12년 전 | 3059 | ||
| 6385 |
희망과열정
|
12년 전 | 923 | |
| 6384 | 12년 전 | 3287 | ||
| 6383 | 12년 전 | 10595 | ||
| 6382 |
|
12년 전 | 5790 | |
| 6381 |
SugarSkull
|
12년 전 | 1030 | |
| 6380 | 12년 전 | 777 | ||
| 6379 |
|
12년 전 | 1982 | |
| 6378 | 12년 전 | 1562 | ||
| 6377 | 12년 전 | 497 | ||
| 6376 |
후라보노보노
|
12년 전 | 1332 | |
| 6375 | 12년 전 | 2866 | ||
| 6374 | 12년 전 | 832 | ||
| 6373 | 12년 전 | 2367 | ||
| 6372 |
takumi22
|
12년 전 | 1238 | |
| 6371 |
개초보제이
|
12년 전 | 772 | |
| 6370 |
고급자가되고
|
12년 전 | 1461 | |
| 6369 | 12년 전 | 881 | ||
| 6368 | 12년 전 | 3178 | ||
| 6367 | 12년 전 | 1879 | ||
| 6366 | 12년 전 | 2876 | ||
| 6365 |
lilyosia
|
12년 전 | 1794 | |
| 6364 | 12년 전 | 1057 | ||
| 6363 | 12년 전 | 1588 | ||
| 6362 | 12년 전 | 2733 | ||
| 6361 | 12년 전 | 2556 | ||
| 6360 | 12년 전 | 1002 | ||
| 6359 | 12년 전 | 2104 | ||
| 6358 |
|
12년 전 | 1787 | |
| 6357 |
에헤라디야자진방아를돌려라
|
12년 전 | 778 | |
| 6356 | 12년 전 | 2084 | ||
| 6355 | 12년 전 | 3787 | ||
| 6354 | 12년 전 | 3101 | ||
| 6353 | 12년 전 | 1546 | ||
| 6352 | 12년 전 | 7769 | ||
| 6351 | 12년 전 | 2537 | ||
| 6350 | 12년 전 | 2798 | ||
| 6349 | 12년 전 | 1880 | ||
| 6348 | 12년 전 | 3546 | ||
| 6347 | 12년 전 | 1446 | ||
| 6346 | 12년 전 | 1183 | ||
| 6345 | 12년 전 | 1835 | ||
| 6344 | 12년 전 | 1409 | ||
| 6343 |
프로프리랜서
|
12년 전 | 2059 | |
| 6342 |
프로프리랜서
|
12년 전 | 1381 | |
| 6341 |
프로프리랜서
|
12년 전 | 1812 | |
| 6340 |
프로프리랜서
|
12년 전 | 1897 | |
| 6339 |
프로프리랜서
|
12년 전 | 1338 | |
| 6338 |
프로프리랜서
|
12년 전 | 1591 | |
| 6337 | 12년 전 | 5267 | ||
| 6336 |
프로프리랜서
|
12년 전 | 1629 | |
| 6335 |
프로프리랜서
|
12년 전 | 951 | |
| 6334 |
프로프리랜서
|
12년 전 | 1328 | |
| 6333 |
프로프리랜서
|
12년 전 | 2438 | |
| 6332 | 12년 전 | 1102 | ||
| 6331 |
돗단배123
|
12년 전 | 1421 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기