MySQL Error 1 (HY000) Trouble creating file Errcode 2

Ashley picture Ashley · Jun 11, 2009 · Viewed 26.7k times · Source

I'm having issues creating a table for my ruby on rails app. It's driving me crazy! The following is returned when I try to create the table:

ERROR 1 (HY000): Can't create/write to file '/usr/local/mysql/data/test_development/users.MYI' (Errcode: 2)

It's worth mentioning I'm a total newbie, btw.

Answer

Dave Swersky picture Dave Swersky · Jun 11, 2009

This forum post seems to deal with the same problem:

Try the following:

  1. mkdir /var/lib/mysql/tmp
  2. chown mysql:mysql /var/lib/mysql/tmp
  3. Add the following line into the [mysqld] section: tmpdir = /var/lib/mysql/tmp
  4. Restart the server