C:\mysql\bin>mysqldump -uroot -p1111 company > company.sql // 백업
C:\mysql\bin>mysql -uroot -p1111 company < company.sql // 복구
mysql> use company
Database changed
mysql> show tables
-> ;
+-------------------+
| Tables_in_company |
+-------------------+
| friend |
+-------------------+
1 row in set (0.00 sec)
mysql> desc friend;
+-------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+-------------+------+-----+---------+-------+
| no | int(11) | YES | | NULL | |
| name | varchar(15) | YES | | NULL | |
| tel | int(30) | | | 0 | |
+-------+-------------+------+-----+---------+-------+
3 rows in set (0.00 sec)
mysql> insert into friend(no,name,tel) values('1','James Kim','01089971234');
Query OK, 1 row affected (0.00 sec)
mysql> select * from friend;
+------+-----------+------------+
| no | name | tel |
+------+-----------+------------+
| 1 | James Kim | 1089971234 |
+------+-----------+------------+
1 row in set (0.00 sec)
mysql> insert into friend(no,name,tel) values('2','Steven Gerrard','010-8997-1235');
Query OK, 1 row affected (0.00 sec)
mysql> select * from friend;
+------+----------------+------------+
| no | name | tel |
+------+----------------+------------+
| 1 | James Kim | 1089971234 |
| 2 | Steven Gerrard | 10 |
+------+----------------+------------+
2 rows in set (0.00 sec)
mysql> delete from friend where no=2;
Query OK, 1 row affected (0.00 sec)
mysql> insert into friend(no,name,tel) values('2','Fernando Torres','01089971236');
Query OK, 1 row affected (0.00 sec)
mysql> select * from friend;
+------+-----------------+------------+
| no | name | tel |
+------+-----------------+------------+
| 1 | James Kim | 1089971234 |
| 2 | Fernando Torres | 1089971236 |
+------+-----------------+------------+
2 rows in set (0.00 sec)
mysql> update friend set tel='1089977777' where no=2;
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> select * from friend;
+------+-----------------+------------+
| no | name | tel |
+------+-----------------+------------+
| 1 | James Kim | 1089971234 |
| 2 | Fernando Torres | 1089977777 |
+------+-----------------+------------+
2 rows in set (0.00 sec)
댓글 없음:
댓글 쓰기