> Create Table: CREATE TABLE `trb3` (
`id` int(11) default NULL,
`name` varchar(50) default NULL,
`purchased` date default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
PARTITION BY RANGE (YEAR(purchased)) (
PARTITION p0 VALUES LESS THAN (1990) ENGINE = MyISAM,
PARTITION p1 VALUES LESS THAN (1995) ENGINE = MyISAM,
PARTITION p2 VALUES LESS THAN (2000) ENGINE = MyISAM,
PARTITION p3 VALUES LESS THAN (2005) ENGINE = MyISAM
)
> LOAD DATA INFILE "/path/to/data" INTO TABLE trb3;
挂了
> SELECT VERSION();
+------------+
| VERSION() |
+------------+
| 5.1.39-log |
+------------+
但是如果我们将虚拟数据插入到 p1,p2,p3
LOAD DATA INFILE "/path/to/data" INTO TABLE trb3; 不会发生错误。
为什么?
答案1
您的 MySQL 服务器是否至少具有对您要导入的文件的读取权限?如果您使用 LOCAL 关键字,则该文件是客户端本地的,否则您必须确保服务器可以访问和读取它...
您可以查看 LOCAL 段落http://dev.mysql.com/doc/refman/5.1/en/load-data.html