MySQL error 1 (HY000) Error creating file Errcode 2
I am having trouble creating a table for my ruby on rails. It drives me crazy! When trying to create a table, the following is returned:
ERROR 1 (HY000): Unable to create / write to file '/usr/local/mysql/data/test_development/users.MYI' (Errcode: 2)
It's worth mentioning that I'm a complete newbie by the way.
This forum post seems to address the same issue:
Try the following:
- mkdir / var / lib / mysql / tmp
- chown mysql: mysql / var / lib / mysql / tmp
- Add the following line to the [mysqld] section: tmpdir = / var / lib / mysql / tmp
- Reboot the server
source to share
I hope you decided that a year has passed. But I ran into this problem and solved it successfully. This error is due to mysql not having permission to modify files in / usr / local / mysql / data. To get around this directory, one had to copy one of the provided cnf files to / usr / local / mysql / support -files to ~ / .my.cnf. I used my-medium.cnf. Then I added the tmpdir = / tmp variable in the [mysqld] section. I chose / tmp because I have read and write permissions. Don't forget to start and restart the mysql server.
source to share