MySQL ERROR:

Error Number: 1

Description: Can't create/write to file '/tmp/#sql_77ca_0.MYI' (Errcode: 2)

Query: SELECT e.*, p.gallery_image_url, p.gallery_thumb_prefix, p.gallery_medium_prefix, p.gallery_text_formatting, p.gallery_auto_link_urls, p.gallery_cf_one_formatting, p.gallery_cf_one_auto_link, p.gallery_cf_two_formatting, p.gallery_cf_two_auto_link, p.gallery_cf_three_formatting, p.gallery_cf_three_auto_link, p.gallery_cf_four_formatting, p.gallery_cf_four_auto_link, p.gallery_cf_five_formatting, p.gallery_cf_five_auto_link, p.gallery_cf_six_formatting, p.gallery_cf_six_auto_link, c.cat_folder, c.cat_name, c.cat_description, m.screen_name, m.username FROM exp_gallery_entries AS e LEFT JOIN exp_galleries AS p ON p.gallery_id = e.gallery_id LEFT JOIN exp_gallery_categories AS c ON c.cat_id = e.cat_id LEFT JOIN exp_members AS m ON e.author_id = m.member_id WHERE e.gallery_id = '2' AND e.status = 'o' AND e.entry_date < 1464251746 ORDER BY rand() desc LIMIT 12