# ERROR 1017 (HY000): Can't find file

**URL:** <https://forums.percona.com/t/error-1017-hy000-cant-find-file/701>\
**Category:** Other MySQL® Questions\
**Created:** [April 4, 2008, 4:07am UTC](https://forums.percona.com/t/error-1017-hy000-cant-find-file/701 "2008-04-04T04:07:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![3molo](https://avatars.discourse-cdn.com/v4/letter/3/b19c9b/32.png) [@3molo](https://forums.percona.com/u/3molo)\
**Post date:** [April 4, 2008, 4:07am UTC](https://forums.percona.com/t/error-1017-hy000-cant-find-file/701/1 "2008-04-04T04:07:14Z")

</div>

Hi,

I have a rather weird problem.

mysql\> use fogbugz;  
Reading table information for completion of table and column names  
You can turn off this feature to get a quicker startup with -A

Database changed  
mysql\> SHOW INDEX FROM FragmentCache;  
ERROR 1017 (HY000): Can’t find file: ‘./fogbugz/FragmentCache.frm’ (errno: 13)

Although;  
-rw-r----- 1 root root 8694 2008-04-02 18:26 /var/lib/mysql/fogbugz/FragmentCache.frm

datadir = /var/lib/mysql

What I did was stop another mysqld, tar the whole fogbugz/, stopped the new mysqld and unpacked the tar.  
Permissions on all files in fogbugz/ are 640 (except fogbugz/ which is 750).

Got any tips?

FYI; Reason I did not do a proper mysqldump is because I could not import it… client hangs.

---

<div class="post-metadata">

**Author:** ![3molo](https://avatars.discourse-cdn.com/v4/letter/3/b19c9b/32.png) [@3molo](https://forums.percona.com/u/3molo)\
**Post date:** [April 4, 2008, 4:13am UTC](https://forums.percona.com/t/error-1017-hy000-cant-find-file/701/2 "2008-04-04T04:13:40Z")

</div>

This goes for most .frms.

ysql\> select \* from Word;  
ERROR 1017 (HY000): Can’t find file: ‘./fogbugz/Word.frm’ (errno: 13)

-rw-r----- 1 root root 8796 2008-04-02 18:26 /var/lib/mysql/fogbugz/Word.frm

---

<div class="post-metadata">

**Author:** ![3molo](https://avatars.discourse-cdn.com/v4/letter/3/b19c9b/32.png) [@3molo](https://forums.percona.com/u/3molo)\
**Post date:** [April 4, 2008, 4:16am UTC](https://forums.percona.com/t/error-1017-hy000-cant-find-file/701/3 "2008-04-04T04:16:12Z")

</div>

I think the issue is:

I upgraded the software fogbugz from v5 to v6.  
So first I had the v6 database created, I then copied the v5 to the data dir of fogbugz. Some files got overwritten.  
Maybe one of the files holds a record of what files (.frms) belong to the database fogbugz?

---

<div class="post-metadata">

**Author:** ![erkules](https://avatars.discourse-cdn.com/v4/letter/e/db5fbb/32.png) [@erkules](https://forums.percona.com/u/erkules)\
**Post date:** [April 5, 2008, 7:17am UTC](https://forums.percona.com/t/error-1017-hy000-cant-find-file/701/4 "2008-04-05T07:17:53Z")

</div>

-rw-r----- 1 root root 8796 2008-04-02 18:26 /var/lib/mysql/fogbugz/Word.frm

The file belongs to root. I think your mysqld is running as user mysql. So mysqld cant read the file.  
After untaring (as root?!) you should do a chown (or chmod, first preferred) on the files.

---

<div class="post-metadata">

**Author:** ![thornton](https://avatars.discourse-cdn.com/v4/letter/t/ac8455/32.png) [@thornton](https://forums.percona.com/u/thornton)\
**Post date:** [April 21, 2009, 11:22am UTC](https://forums.percona.com/t/error-1017-hy000-cant-find-file/701/5 "2009-04-21T11:22:22Z")

</div>

Thanks erkules, I was facing the same problem. I did a chmod and it fixed it.  
chmod 755 /export/home/local/mysql/var//_._
