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('변경할 패스워드'); - 패스워드변경
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 6530 |
퍼블리셔강
|
12년 전 | 647 | |
| 6529 | 12년 전 | 1303 | ||
| 6528 | 12년 전 | 621 | ||
| 6527 | 12년 전 | 790 | ||
| 6526 | 12년 전 | 6580 | ||
| 6525 | 12년 전 | 549 | ||
| 6524 | 12년 전 | 837 | ||
| 6523 | 12년 전 | 488 | ||
| 6522 | 12년 전 | 534 | ||
| 6521 | 12년 전 | 797 | ||
| 6520 | 12년 전 | 739 | ||
| 6519 | 12년 전 | 1743 | ||
| 6518 |
가슴시린하늘
|
12년 전 | 1723 | |
| 6517 | 12년 전 | 1362 | ||
| 6516 | 12년 전 | 5225 | ||
| 6515 | 12년 전 | 1494 | ||
| 6514 | 12년 전 | 1597 | ||
| 6513 | 12년 전 | 953 | ||
| 6512 | 12년 전 | 1979 | ||
| 6511 | 12년 전 | 1368 | ||
| 6510 | 12년 전 | 3060 | ||
| 6509 |
프로프리랜서
|
12년 전 | 2547 | |
| 6508 |
프로프리랜서
|
12년 전 | 1897 | |
| 6507 |
프로프리랜서
|
12년 전 | 2373 | |
| 6506 |
프로프리랜서
|
12년 전 | 1854 | |
| 6505 |
프로프리랜서
|
12년 전 | 1631 | |
| 6504 | 12년 전 | 1026 | ||
| 6503 | 12년 전 | 1127 | ||
| 6502 |
프로프리랜서
|
12년 전 | 5555 | |
| 6501 |
프로프리랜서
|
12년 전 | 2600 | |
| 6500 |
프로프리랜서
|
12년 전 | 3082 | |
| 6499 |
프로프리랜서
|
12년 전 | 1750 | |
| 6498 |
프로프리랜서
|
12년 전 | 1463 | |
| 6497 | 12년 전 | 807 | ||
| 6496 |
yunkiri486
|
12년 전 | 1808 | |
| 6495 | 12년 전 | 917 | ||
| 6494 | 12년 전 | 1491 | ||
| 6493 | 12년 전 | 2763 | ||
| 6492 |
오늘도망했다
|
12년 전 | 2337 | |
| 6491 |
오늘도망했다
|
12년 전 | 1677 | |
| 6490 |
오늘도망했다
|
12년 전 | 6658 | |
| 6489 |
오늘도망했다
|
12년 전 | 2494 | |
| 6488 |
홈피119
|
12년 전 | 698 | |
| 6487 | 12년 전 | 670 | ||
| 6486 | 12년 전 | 1407 | ||
| 6485 | 12년 전 | 2049 | ||
| 6484 | 12년 전 | 899 | ||
| 6483 | 12년 전 | 716 | ||
| 6482 | 12년 전 | 1341 | ||
| 6481 | 12년 전 | 1468 | ||
| 6480 |
Header
|
12년 전 | 690 | |
| 6479 |
|
12년 전 | 1124 | |
| 6478 |
개초보제이
|
12년 전 | 1394 | |
| 6477 | 12년 전 | 792 | ||
| 6476 | 12년 전 | 1075 | ||
| 6475 | 12년 전 | 3678 | ||
| 6474 | 12년 전 | 1421 | ||
| 6473 | 12년 전 | 961 | ||
| 6472 | 12년 전 | 848 | ||
| 6471 |
AMDbest
|
12년 전 | 1203 | |
| 6470 |
jinmuk
|
12년 전 | 1445 | |
| 6469 |
jinmuk
|
12년 전 | 4249 | |
| 6468 |
jinmuk
|
12년 전 | 5575 | |
| 6467 | 12년 전 | 695 | ||
| 6466 |
jinmuk
|
12년 전 | 2271 | |
| 6465 |
jinmuk
|
12년 전 | 6733 | |
| 6464 |
jinmuk
|
12년 전 | 2407 | |
| 6463 |
jinmuk
|
12년 전 | 9332 | |
| 6462 |
희망과열정
|
12년 전 | 533 | |
| 6461 |
Header
|
12년 전 | 722 | |
| 6460 |
희망과열정
|
12년 전 | 1350 | |
| 6459 |
프리랜서개발자
|
12년 전 | 1676 | |
| 6458 | 12년 전 | 1335 | ||
| 6457 |
jinmuk
|
12년 전 | 1941 | |
| 6456 |
jinmuk
|
12년 전 | 2348 | |
| 6455 |
jinmuk
|
12년 전 | 3204 | |
| 6454 |
jinmuk
|
12년 전 | 2174 | |
| 6453 |
jinmuk
|
12년 전 | 2351 | |
| 6452 |
jinmuk
|
12년 전 | 2314 | |
| 6451 |
jinmuk
|
12년 전 | 1599 | |
| 6450 |
jinmuk
|
12년 전 | 1398 | |
| 6449 |
jinmuk
|
12년 전 | 1039 | |
| 6448 |
jinmuk
|
12년 전 | 1238 | |
| 6447 |
jinmuk
|
12년 전 | 2007 | |
| 6446 |
jinmuk
|
12년 전 | 1563 | |
| 6445 |
jinmuk
|
12년 전 | 1263 | |
| 6444 |
jinmuk
|
12년 전 | 2306 | |
| 6443 |
jinmuk
|
12년 전 | 2044 | |
| 6442 |
jinmuk
|
12년 전 | 1883 | |
| 6441 |
jinmuk
|
12년 전 | 1617 | |
| 6440 |
jinmuk
|
12년 전 | 2315 | |
| 6439 |
jinmuk
|
12년 전 | 1134 | |
| 6438 |
wndProc
|
12년 전 | 776 | |
| 6437 | 12년 전 | 397 | ||
| 6436 |
senseme
|
12년 전 | 542 | |
| 6435 | 12년 전 | 1045 | ||
| 6434 | 12년 전 | 2474 | ||
| 6433 | 12년 전 | 2485 | ||
| 6432 | 12년 전 | 1561 | ||
| 6431 |
밥먹고합시다
|
12년 전 | 1191 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기