Well, I got this issue on my server, so I'm gonna post the solution here in case someone else need it.
I was running this command:
and getting error:
In CentOS there is a Enhanced Security system called SELinux, so we need to set special settings on the specific folder, in this case: /tmpArmada/ so:
then you can verify the change using the command: ls -ltrZ
So what we did was set the type: tmp_t to the folder. And now mysql is able to write on it
I was running this command:
Code:
mysql --user=otserv --password=otservpass -D armada -e "select * from concursos INTO OUTFILE '/tmpArmada/concursos.txt' FIELDS TERMINATED BY ',' ENCLOSED BY '\"' LINES TERMINATED BY '\r\n'"
and getting error:
Code:
ERROR 1 (HY000) at line 1: Can't create/write to file '/tmpArmada/concursos.txt' (Errcode: 13)
In CentOS there is a Enhanced Security system called SELinux, so we need to set special settings on the specific folder, in this case: /tmpArmada/ so:
Code:
#chown mysql:mysql /tmpArmada
#chcon -Rv --type=tmp_t /tmpArmada
context of /tmpArmada changed to root:object_r:tmp_t
then you can verify the change using the command: ls -ltrZ
Code:
# ls -ltrZ
drwxrwxrwt [B]mysql [/B][B]mysql [/B]root:object_r:[B]tmp_t[/B] tmpArmada
So what we did was set the type: tmp_t to the folder. And now mysql is able to write on it