Question

Can anyone please let me know why I keep getting a permission denied error even though I am logged in as the admin? I am trying to load a text file into a table in mysql workbench.

use alpha;  
drop table raw_finance_data;  
create table raw_finance_data 
(  
    Company         varchar(256),  
    Profit_Center   varchar(256),  
    Year            varchar(256),  
    Scenario        varchar(256),  
    Account         varchar(256),  
    total           float  
);  

load data infile 'D:/Users/alpha/Documents/Excel/fin.txt' into table alpha.raw_finance_data FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';  

I keep getting the error below. I am in the database as the admin.

Error Code: 29. File 'D:\Users\alpha\Documents\Excel\fin.txt' not found (Errcode: 13 - Permission denied)
Was it helpful?

Solution

If your file is local to your client machine then you need to include 'local' i.e.

load data local infile 'D:/Users/alpha/Documents/Excel/fin.txt' into table alpha.raw_finance_data FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top