Browse - Computer Tips - How can I fix an error from mysqldump saying it can not write to /tmp/MY(random-name) (Error 2) ?

Date: 2012apr23
Product: mysql
OS: Linux
Distro: RedHat/Fedora/CentOS

Q.   How can I fix an error from mysqldump saying it can not write to /tmp/MY(random-name) (Error 2) ?
I am not even outputting to there!

A.   On my Fedora box I fixed this problem by adding a line
to /etc/my.cnf:

[mysqld] ... tmpdir=/var/tmp <-- added this
And restarting mysqld:
systemctl restart mysqld.service