Description:
MySQL won't export or load data that's on a drive letter created by the SUBST command.
How to repeat:
[code]mysql>
mysql> # Microsoft Windows XP [Version 5.1.2600]
mysql> # (C) Copyright 1985-2001 Microsoft Corp.
mysql>
mysql> use test;
Database changed
mysql> select version();
+---------------------+
| version() |
+---------------------+
| 5.0.67-community-nt |
+---------------------+
1 row in set (0.00 sec)
mysql>
mysql> desc dir2;
+-------+-----------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+-----------+------+-----+---------+-------+
| line | char(200) | YES | | NULL | |
+-------+-----------+------+-----+---------+-------+
1 row in set (0.00 sec)
mysql> delete from dir2;
Query OK, 54 rows affected (0.00 sec)
mysql>
mysql> # P: is a subst drive...
mysql> load data infile 'P:/AHK/New-Hotkeys.ahk' into table dir2 lines terminated by '\r\n';
ERROR 29 (HY000): File 'P:\AHK\New-Hotkeys.ahk' not found (Errcode: 2)
mysql>
mysql> # actual path...
mysql> load data infile 'C:/zCDROMS/CodingTemp/AHK/New-Hotkeys.ahk' into table dir2 lines terminated by '\r\n';
Query OK, 54 rows affected, 11 warnings (0.00 sec)
Records: 54 Deleted: 0 Skipped: 0 Warnings: 11
mysql>
mysql> select count(*) from dir2;
+----------+
| count(*) |
+----------+
| 54 |
+----------+
1 row in set (0.00 sec)
mysql>
mysql> # export to subst drive...
mysql> SELECT * INTO OUTFILE 'p:/ahk/TestExport.txt' LINES TERMINATED BY '\r\n' FROM dir2;
ERROR 1 (HY000): Can't create/write to file 'p:\ahk\TestExport.txt' (Errcode: 2)
mysql>
mysql> # export to actual path
mysql> SELECT * INTO OUTFILE 'C:/zCDROMS/CodingTemp/AHK/TestExport.txt' LINES TERMINATED BY '\r\n' FROM dir2;
Query OK, 54 rows affected (0.00 sec)
mysql> exit[/code]