Encountered this error while taking mysql dump mysqldump: Couldn't execute 'show fields from `association`': Can't create/write to file '/tmp/#sql_647f_0.MYI' (Errcode: 2) (1) Reason : Can’t find tmp location to save it’s files OS : centos Solution : Step I Open my.cnf (in this case it was at the location /etc/my.cnf). Step II Under [mysqld] add one more parameterad as : tmpdir=/var/tmp that solved the problem Usually mysql uses /tmp or /var/tmp or /usr/tmp for storing it’s variable but if it doesn’t then try the above method.