Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MYSQL into outfile "access denied" - but my user has "ALL" access.. and the folder is CHMOD 777

Any ideas?

SELECT * INTO OUTFILE '/home/myacnt/docs/mysqlCSVtest.csv' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '*' LINES TERMINATED BY '\n' FROM tbl_property  WHERE managerGroupID = {$managerGroupID} 

Error:

Access denied for user 'asdfsdf'@'localhost' (using password: YES) 
like image 947
Shackrock Avatar asked May 22 '11 23:05

Shackrock


People also ask

How do I fix access denied in MySQL?

To resolve the error, you must create a user with the following command: mysql> GRANT ALL ON *. * to user_name@localhost IDENTIFIED BY 'password'; Replace user_name with the user's username and password with the user's password.

Where does MySQL store Outfile?

C:\ProgramData\MySQL\MySQL Server 5.6\data\name.csv Show activity on this post. Show activity on this post. If you don't specify an absoulte path but use something like INTO OUTFILE 'output.


1 Answers

Try executing this SQL command:

> grant all privileges    on YOUR_DATABASE.*    to 'asdfsdf'@'localhost'    identified by 'your_password'; > flush privileges;  

It seems that you are having issues with connecting to the database and not writing to the folder you’re mentioning.

Also, make sure you have granted FILE to user 'asdfsdf'@'localhost'.

> GRANT FILE ON *.* TO 'asdfsdf'@'localhost'; 
like image 88
Pablo Santa Cruz Avatar answered Sep 18 '22 09:09

Pablo Santa Cruz