MySQL : Error :1004 SQLSTATE: HY000 (ER_CANT_CREATE_FILE) Can't create file


Posted on : Mon, 12th Oct 15 11:43 am (Updated on : Mon, 12th Oct 15 11:43 am) UTC
Author : Code2care
2314 votes

This error may occur when creating a .frm file or copying it form one location to another fails.

If the .frm file is being moved or you do not have access permissions then you may get ER_CANT_CREATE_FILE.

It may also occur during creating of new table using LIKE clause.

What is a .frm file?

Example to access .frm file (Using XAMPP)

  1. Create table : mydb.mytable (name varchar(10));
  2. Now go to location where mysql is installed : XAMPP/xamppfiles/var/mysql/mydb/mytable.frm
  3. Note you may not have access to this file only if you have root access.

Code2care's mission is to share varied knowledge in technical and non-technical areas gathered during day-to-day learnings and development activities so that our visitors can leverage this portal to find solutions to their queries without re-inventing the wheel. Technical posts include Learnings, Tutorials, Video Tutorials, Code Snippets, Tips-n-tricks.

Follow us : Facebook - Twitter - Google +