HiveBrain v1.2.0
Get Started
← Back to all entries
snippetsqlMinor

mysqldump: Error: 'Can't create/write to file

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
canerrorfilecreatemysqldumpwrite

Problem

Can't create temporary files on /var/tmp.

mysqldump: Error: 'Can't create/write to file '/var/tmp/mysql.k6NKGk/#sql_5dc_2.MAI' (Errcode: 2)' when trying to dump tablespaces


On my OS.

id mysql
uid=60(mysql) gid=105(mysql) groups=105(mysql)

ls -l /var/
drwxrwxrwt  2 root root  72 oct 24 16:43 tmp


What can I do?

Solution

Perhaps you can change the owner with

chown -R mysql:mysql /var/tmp


Check to see if there is a [mysqldump] header in /etc/my.cnf. It may look like this:

[mysqldump]
tmpdir=/var/tmp


or perhaps under the [mysqld] header

[mysqldump]
tmpdir=/var/tmp


Try commenting it out and trying mysqldump again.

Code Snippets

chown -R mysql:mysql /var/tmp
[mysqldump]
tmpdir=/var/tmp
[mysqldump]
tmpdir=/var/tmp

Context

StackExchange Database Administrators Q#27553, answer score: 6

Revisions (0)

No revisions yet.