Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't find file: './ci/users.frm' (errno: 13)

I installed LAMP on Ubuntu 11.04 and copy project from Windows. PHP directory (/ci/) to var/www/ and MySQL project directory (/ci/) to var/lib/mysql/

Full text of error that i get:

A Database Error Occurred

    Error Number: 1017
    Can't find file: './ci/users.frm' (errno: 13)
    SELECT COUNT(*) AS `numrows` FROM (`users`) WHERE `email` = '[email protected]'

I googled that its permission problem, but don't know what do next.

Log from /var/log/mysql/error.log:

    110622 19:27:21 [ERROR] /usr/sbin/mysqld: Can't find file: './ci/users.frm' (errno: 13)
like image 414
aTei Avatar asked Jun 22 '11 16:06

aTei


2 Answers

As well as the files being readable by the MySQL user, the directory containing the .MYI files needs to be read, write and executable by the MySQL user. On my system this was achieved by:

chown -R mysql:mysql /var/lib/mysql/dbname
chmod -R 660 /var/lib/mysql/dbname
chown mysql:mysql /var/lib/mysql/dbname
chmod 700 /var/lib/mysql/dbname
like image 180
Simon Wheatley Avatar answered Nov 02 '22 12:11

Simon Wheatley


Permissions problem meaning the permissions on the file. MySQL probably can't read it. Just change the owner and group to mysql and it should work.

chown mysql:mysql /var/lib/mysql/ci/*
like image 30
Brent Baisley Avatar answered Nov 02 '22 11:11

Brent Baisley