I executed the query in mysql as
select * into outfile "/tmp/results.out" from table_x;
which in-turn wrote all the records in that table to the file in /tmp directory. The file was created with the following permissions.
-rw-rw-rw- 1 mysql mysql 6.6K Nov 14 10:14 /tmp/results.out
I know that it is not possible to delete this file from my login. But I tried removing this from MySQL, but I get the following error message:
mysql> system rm /tmp/results.out
rm: cannot remove `/tmp/results.out': Operation not permitted
PS: I do not have root permissions.
The Delete query in MySQL can delete more than one row from a table in a single query. This proves to be advantages when removing large numbers of rows from a database table. Once a Delete row in MySQL row has been deleted, it cannot be recovered.
Solution. By default, MySQL workbench is started in safe mode, and can't update or delete, without a “WHERE” condition, see the error message. To fix it, in menu, selects “Edit” -> “Preferences” -> “SQL Queries”, uncheck the “Safe Updates” checkbox. Done, try reconnect and issue the delete command again.
The file's owner group is mysql. Please use the id
command to find out another user of that group and try deleting it. It appears that the user ID you are using to delete the file may not have write access on tmp directory.
Are you able to truncate the contents of the file? Please do this only if you don't want the results.out file in /tmp/
echo " " > /tmp/results.out
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With