Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I know there are already several postings on the stackexchange sites about Linux permissions, but I can't find the answer to my problem.

I'm working on my own laptop (no web server or anything) with mySQL. I'm using mySQL directly from the console client. Frequently, I want to run a query and save the results elsewhere for further work in LibreOffice or whatever. I use select ... into outfile 'path+file';. Even though I'm logged in as myself, I'm unable to save the output file into my ~/Downloads/ directory, which I'm using as a temp directory. I understand that the mySQL server is running under a special user, not me. Since I'm the only real user on here, I executed sudo chmod 7777 ~/Downloads, and see it now shows drwsrwsrwt. After the chmod, I restated the server. However, I still get ERROR 1045 (28000): Access Denied... if I try to output into this folder when logged into mySQL as me. Logged in as root, I get ERROR 1 (HY0000): Can't create/write to file ... when I run the same command.

Hence, I'm stuck logging in as root, exporting my data to /tmp/, then doing sudo cp from another terminal to get my data. Any suggestions on what I need to do to fix this?

share|improve this question

I am doing the same thing and got similar errors. Then I realized my path was not exactly correct. Gave it the correct path all was well. If you are literally using '~/Downloads' for the path I expect this is not correct. More likely it's something like '~drew/Downloads'. You could also try using the full path to your downloads directory.

TD

share|improve this answer
    
Thanks TD, but no dice. Even if I enter the full /home/ahowe42/Downloads path, it still can't access it. – Dr. Drew May 22 '13 at 20:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .