See http://dev.mysql.com/doc/refman/5.0/en/cannot-create.html
There are several reasons for this Error:
- No disk space left
- Antivirus or Microsoft Security Essential blocks the file
- Running two instances of MySQL which are trying to write the same file
- The user running MySQL has sufficient rights on this folder
Solutions
- Rename(delete) the file
- Stop MySQL, rename the file, start MySQL.
- Add the folder to the Antivirus's/Microsoft Security Essential's exclude list
- Check in the taskmanager if there are two instances running of mysql(d).
- Running defrag
- Restart Computer/MySQL
- When you have PhpMyAdmin installed, select your database, scroll down and select and click "Repair".
- When the error occurred when using mysqldump add this parameter: --skip-lock-tables and --lock-tables=false
Other, similar questions on SO, Google.