mysql> select count(*) from seq_test; +----------+ | count(*) | +----------+ | 111 | +----------+ 1 row in set (0.00 sec) mysql> truncate table seq_test; Query OK, 0 rows affected (0.00 sec) mysql> LOAD DATA LOCAL INFILE '/tmp/backup_v0.txt' INTO TABLE seq_test; Query OK, 111 rows affected (0.00 sec) Records: 111 Deleted: 0 Skipped: 0 Warnings: 0 mysql> select count(*) from seq_test; +----------+ | count(*) | +----------+ | 111 | +----------+ 1 row in set (0.00 sec)
[root@t-xi-mysql01 tmp]# cp backup_v0.txt seq_test.txt[root@t-xi-mysql01 tmp]# mysqlimport -u root -p --local runoob seq_test.txtEnter password:runoob.seq_test: Records: 111 Deleted: 0 Skipped: 111 Warnings: 0
[root@t-xi-mysql01 tmp]# mysqldump -u root -p runoob seq_test|gzip > backup_data.zip Enter password: [root@t-xi-mysql01 tmp]# gunzip -c backup_data.zip>backup_data.sql [root@t-xi-mysql01 tmp]# [root@t-xi-mysql01 tmp]# mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 18 Server version: 5.1.71 Source distribution Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> use runoob; 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> source backup_data.sql Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.01 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 111 rows affected (0.00 sec) Records: 111 Duplicates: 0 Warnings: 0 Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) mysql> select count(*) from seq_test; +----------+ | count(*) | +----------+ | 111 | +----------+ 1 row in set (0.00 sec)