List:General Discussion« Previous MessageNext Message »
From:Mogens Melander Date:April 12 2007 12:52am
Subject:Re: import fails: error 13
View as plain text  
You need a LOCAL in your LOAD statement.

LOAD DATA [LOW_PRIORITY | CONCURRENT] [LOCAL] INFILE 'file_name'
    [REPLACE | IGNORE]
    INTO TABLE tbl_name
    [FIELDS
        [TERMINATED BY 'string']
        [[OPTIONALLY] ENCLOSED BY 'char']
        [ESCAPED BY 'char']
    ]
    [LINES
        [STARTING BY 'string']
        [TERMINATED BY 'string']
    ]
    [IGNORE number LINES]
    [(col_name_or_user_var,...)]
    [SET col_name = expr,...)]


-- 
Later

Mogens Melander
+45 40 85 71 38
+66 870 133 224


On Thu, April 12, 2007 02:37, Thufir wrote:
> [thufir@localhost ~]$
> [thufir@localhost ~]$ cat abc.txt -n
>      1  "A1","B1","C1"
>      2  "A2","B2","C2"
>      3  "A3","B3","C3"
> [thufir@localhost ~]$
> [thufir@localhost ~]$ mysql -u root
> Welcome to the MySQL monitor.  Commands end with ; or \g.
> Your MySQL connection id is 21 to server version: 5.0.27
>
> Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
>
> mysql> show databases;
> +--------------------+
> | Database           |
> +--------------------+
> | information_schema |
> | alpha              |
> | bravo              |
> | charlie            |
> | delta              |
> | mysql              |
> | test               |
> +--------------------+
> 7 rows in set (0.00 sec)
>
> mysql> use delta;
> 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> show tables;
> +-----------------+
> | Tables_in_delta |
> +-----------------+
> | abc             |
> +-----------------+
> 1 row in set (0.00 sec)
>
> mysql> describe abc;
> +-------+------+------+-----+---------+-------+
> | Field | Type | Null | Key | Default | Extra |
> +-------+------+------+-----+---------+-------+
> | a     | text | NO   |     |         |       |
> | b     | text | NO   |     |         |       |
> | c     | text | NO   |     |         |       |
> +-------+------+------+-----+---------+-------+
> 3 rows in set (0.01 sec)
>
> mysql> LOAD DATA INFILE '/home/thufir/abc.txt' INTO TABLE delta.abc;
> ERROR 13 (HY000): Can't get stat of '/home/thufir/abc.txt' (Errcode: 13)
> mysql>
> mysql> quit
> Bye
> [thufir@localhost ~]$
> [thufir@localhost ~]$ date
> Thu Apr 12 01:35:36 BST 2007
> [thufir@localhost ~]$
>
>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/mysql?unsub=1
>
>
> --
> This message has been scanned for viruses and
> dangerous content by OpenProtect(http://www.openprotect.com), and is
> believed to be clean.
>



-- 
This message has been scanned for viruses and
dangerous content by OpenProtect(http://www.openprotect.com), and is
believed to be clean.

Thread
import fails: error 13Thufir12 Apr
  • Re: import fails: error 13Mogens Melander12 Apr
  • Re: import fails: error 13Chris12 Apr