[mysql@wallet01 ~]$ mysql -uroot -p
Enter password:
mysql> show variables like '%secure%';
+--------------------------+-----------------------+
| Variable_name | Value |
+--------------------------+-----------------------+
| require_secure_transport | OFF |
| secure_auth | ON |
| secure_file_priv | /var/lib/mysql-files/ |
+--------------------------+-----------------------+
3 rows in set (0.00 sec)
mysql> use soe
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> select * from customer into outfile '/var/lib/mysql-files/customer.txt' fields terminated by ',' optionally enclosed by '"' lines terminated by '\n';
Query OK, 300000 rows affected (1.37 sec)
mysql> select count(*) from customer;
+----------+
| count(*) |
+----------+
| 300000 |
+----------+
1 row in set (0.06 sec)
mysql> set foreign_key_checks=0;
Query OK, 0 rows affected (0.00 sec)
mysql> truncate table customer;
Query OK, 0 rows affected (0.15 sec)
mysql> select count(*) from customer;
+----------+
| count(*) |
+----------+
| 0 |
+----------+
1 row in set (0.00 sec)
mysql> load data infile '/var/lib/mysql-files/customer.txt' into table customer fields terminated by ',' optionally enclosed by '"' lines terminated by '\n';
Query OK, 300000 rows affected (4.45 sec)
Records: 300000 Deleted: 0 Skipped: 0 Warnings: 0
mysql> set foreign_key_checks=1;
Query OK, 0 rows affected (0.00 sec)
mysql> select count(*) from customer;
+----------+
| count(*) |
+----------+
| 300000 |
+----------+
1 row in set (0.05 sec)