2016년 2월 15일 월요일

, , , , , , ,

Deleting Data in a Mysql Table Log [Linux]

When using the truncate [table name] command does not delete the table, only those records can be deleted.
Here is the example of deleting data in a mysql table.


mysql> show databases;
+--------------------------+
| Database                         |
+--------------------------+
| information_schema  |
| single                                 |
| test                                     |
+--------------------------+
3 rows in set (0.00 sec)

mysql> use single
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed

mysql> show tables;
+---------------------------+
| Tables_in_single            |
+---------------------------+
| ArchivePVRequests    |
| ExternalDataServers   |
| PVAliases                         |
| PVTypeInfo                     |
+---------------------------+
4 rows in set (0.00 sec)

mysql> truncate ArchivePVRequests;
Query OK, 0 rows affected (0.02 sec)

mysql> truncate ExternalDataServers;
Query OK, 0 rows affected (0.00 sec)

mysql> truncate PVAliases;
Query OK, 0 rows affected (0.00 sec)

mysql> truncate PVTypeInfo;
Query OK, 0 rows affected (0.00 sec)

mysql> show tables;
+---------------------------+
| Tables_in_single            |
+---------------------------+
| ArchivePVRequests    |
| ExternalDataServers   |
| PVAliases                         |
| PVTypeInfo                     |
+---------------------------+
4 rows in set (0.00 sec)

위치: Yuseong-gu, Daejeon, South Korea

0 개의 댓글:

댓글 쓰기