Reputation: 449
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)
Upvotes: 8
Views: 20822
Reputation: 3386
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';
Upvotes: 14