Issue moving database between servers (cannot find .frm file even though it's there) I used MAMP on my local machine to make a little site with a mysql database. I moved all the site files over the to server. Great.

The name of my database is roster and it has one table called users. I copied the 'roster' folder which contains the following files:

db.opt
users.frm
users.MYD
users.MYI


I put the 'roster' folder in the mysql directory. I run the following:

&lt;?php
$db = mysql_connect("localhost","username","password") or die ('Fail message1');
mysql_select_db("roster") or die("Fail message2");
?&gt;


No error. Awesome. But when I run the following:

$query = "SELECT last_name, first_name, u_name, skype_id, primary_location FROM users";

$result = mysql_query($query)or die('query error'.mysql_error());


Then I receive the following error:

query errorCan't find file: './roster/users.frm' (errno: 13)


Furthermore, when I login to the server and login to mysql. I see the database and table:

mysql&gt; show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| phones_db          |
| roster             |
+--------------------+
4 rows in set (0.00 sec)

mysql&gt; use roster;
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&gt; show tables;
+------------------+
| Tables_in_roster |
+------------------+
| users            |
+------------------+
1 row in set (0.00 sec)

mysql&gt; select * from users;
ERROR 1017 (HY000): Can't find file: './roster/users.frm' (errno: 13)
mysql&gt; 


I checked the 'roster' folder and it contains the four files mentioned at the beginning of this post. The file is where it supposed to be, right? Did I move the database wrong? What gives? Any ideas?
PROBLEM
You have a file permission issue.
The INFORMATION_SCHEMA database will not notice when doing just show tables; because it will scan for the .frm's existence. It's when the storage engine attempts to access the physical files (.MYD and .MYI') that mysqld will complain. All physical files of any table must have mysqlas its owner. When the error saysCan't find file: './roster/users.frm' (errno: 13)`, it really means it cannot find the table's physical files with proper file permissions.
SOLUTION
Change the owner of the roster folder and its contents to mysql.
GIVE IT A TRY !!!