mysqldump --tab: file already exists when it does not

This is all on one server.

mysqldump -u root -p --tab=/var/tmp --fields-terminated-by=, db1

mysqldump: Got error: 1086: "File '/var/tmp/db1_tbl.txt' already exists" when executing 'SELECT INTO OUTFILE'

Strange. But the file doesn't exist?

ls /var/tmp/db* /var/tmp/db1_tbl.sql

No .txt file? Where is the delimited text file?

I am on CentOS 7:

mysql Ver 15.1 Distrib 5.5.52-MariaDB, for Linux (x86_64) using readline 5.1

I understand this outputs to the server host. But I am running this command from the server.

Answer Answered by kanika satija in this comment.

Please provide below information to solve this issue :- 1) Provide all the steps you have performed 2) output of below commands: a) getenforce b) ls -ldZ /var/tmp/ [to check context type]

3) Have you changed the context type of directory /var/tmp by below command in case SElinux checked by getenforce command is "enforcing" a) semanage fcontext -a -t mysqld_db_t "/var/tmp(/.*)?" b) restorecon -vR /var/tmp/

Comments

Comments loading...
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.