Re: import fails: error 13

2007-04-11 Thread Chris



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)


'13' means permission denied.

That is - mysql (which is running as user 'mysql' most likely), can't 
read the /path/to/abc.txt file.


Place the file in the /tmp folder or something and you won't have a problem.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]




Re: import fails: error 13

2007-04-11 Thread Mogens Melander
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:
> [EMAIL PROTECTED] ~]$
> [EMAIL PROTECTED] ~]$ cat abc.txt -n
>  1  "A1","B1","C1"
>  2  "A2","B2","C2"
>  3  "A3","B3","C3"
> [EMAIL PROTECTED] ~]$
> [EMAIL PROTECTED] ~]$ 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
> [EMAIL PROTECTED] ~]$
> [EMAIL PROTECTED] ~]$ date
> Thu Apr 12 01:35:36 BST 2007
> [EMAIL PROTECTED] ~]$
>
>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
>
>
> --
> 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.


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



import fails: error 13

2007-04-11 Thread Thufir
[EMAIL PROTECTED] ~]$ 
[EMAIL PROTECTED] ~]$ cat abc.txt -n
 1  "A1","B1","C1"
 2  "A2","B2","C2"
 3  "A3","B3","C3"
[EMAIL PROTECTED] ~]$ 
[EMAIL PROTECTED] ~]$ 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
[EMAIL PROTECTED] ~]$ 
[EMAIL PROTECTED] ~]$ date
Thu Apr 12 01:35:36 BST 2007
[EMAIL PROTECTED] ~]$ 



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]