Jump to content

Why would this not work?


carlg

Recommended Posts

This is in a shell script

 

This works perfectly fine

 

mysql -u$dbuser -p$dbpass --database=db -e "SELECT * FROM mytable"

 

But this gives me an access denied error (permissions on dir are OK)

mysql -u$dbuser -p$dbpass --database=db -e "SELECT * INTO OUTFILE '../tmp/mytable.unl' FIELDS TERMINATED BY '|' FROM mytable"

 

 

 

 

Link to comment
Share on other sites

I got it to work using the mysql root user as the uname and password and I had to change the file path to an absolute path.

 

I still can't get it to work with a normal db user.

 

I even granted the user FILE permissions and made sure the linux dir perms were correct.

 

Still no luck.

Link to comment
Share on other sites

I got it to work using the mysql root user as the uname and password and I had to change the file path to an absolute path.

 

I still can't get it to work with a normal db user.

 

I even granted the user FILE permissions and made sure the linux dir perms were correct.

 

Still no luck.

Has nothing to do with the FS... just the DB... since root works and normal user doesn't, the FILE permission obviously wasn't applied... did you FLUSH PRVILEDGES, or restart the server?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.