MySQL表的导入

mysql> truncate actor;
ERROR 1701 (42000): Cannot truncate a table referenced in a foreign key constraint (`sakila`.`film_actor`, CONSTRAINT `fk_film_actor_actor`)

若一个table 中的某个column是其他table的foreign key,那么,该table不能使用truncatedrop。

解决方法:https://www.cnblogs.com/hankyoon/p/5169615.html

如果不希望加载文件中的前100行,如下: 

load data infile '/data/actor.txt' into table actor fields terminated by ',' ignore 100 lines;

也可以使用mysqlimport 导入。

原文地址:https://www.cnblogs.com/kate7/p/13541517.html