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" Link to comment https://forums.phpfreaks.com/topic/73898-why-would-this-not-work/ 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.... Link to comment https://forums.phpfreaks.com/topic/73898-why-would-this-not-work/#findComment-373141 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. Link to comment https://forums.phpfreaks.com/topic/73898-why-would-this-not-work/#findComment-373287 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? Link to comment https://forums.phpfreaks.com/topic/73898-why-would-this-not-work/#findComment-373382 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 Link to comment https://forums.phpfreaks.com/topic/73898-why-would-this-not-work/#findComment-373400 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.