carlg Posted October 19, 2007 Share Posted October 19, 2007 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" Quote Link to comment Share on other sites More sharing options...
fenway Posted October 19, 2007 Share Posted October 19, 2007 OUTFILE normally resides on the server... different set of permissions.... Quote Link to comment Share on other sites More sharing options...
carlg Posted October 19, 2007 Author Share Posted October 19, 2007 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. Quote Link to comment Share on other sites More sharing options...
fenway Posted October 19, 2007 Share Posted October 19, 2007 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? Quote Link to comment Share on other sites More sharing options...
carlg Posted October 19, 2007 Author Share Posted October 19, 2007 Did not restart the server I will try that Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.