I have various MySQL databases on different servers and at different versions. I'm using the same
mysqldump command across Linux versions without issue except for this new Red Hat 7.6 server.
mysqldump --tab=/var/tmp/mysql/mysql.20190808/wikidb \
--opt --user=root --password=[password] wikidb
Prior to the mysqldump command:
mkdir -p /var/tmp/mysql/mysql.20190808/wikidb
chown -R mysql:mysql /var/tmp/mysql/mysql.20190808
chmod 777 /var/tmp/mysql/mysql.20190808
This is all scripted so no chance for a typo.
On all the older servers, and especially the older wiki servers this server is replacing, the command works successfully. I get a list of all the tables and
.txt files for the database in the directory.
On the new server, I get the very first table,
back_archive.sql, and then an error:
mysqldump: Got error: 1: "Can't create/write to file '/var/tmp/mysql/mysql.20190808/wikidb/back_archive.txt' (Errcode: 2)" when executing 'SELECT INTO OUTFILE'
I've tried various permissions including 1777 to give it a sticky bit just in case and it still fails. Ownership is confirmed as
mysql:mysql and the database owner is
I'd done quite a bit of searching and reading of the man pages and everyone pretty much blames it on ownership or directory permissions but as noted above, I believe I've done it correctly, especially since it's a script and is working on every other server.
I will note this is my first master/master replication server. I didn't find anything specific regarding this sort of configuration but I thought I'd mention it.