MilesWeb
MilesWeb Hosting Forum

Please login or register.

Login with username, password and session length

 

News:

SMF - Just Installed!


Author Topic: Mysql - Can't find file: (errno: 13)  (Read 5057 times)

0 Members and 1 Guest are viewing this topic.

Offline Dipak Bhoi

  • MilesWeb Team Member
  • Full Member
  • ***
  • Posts: 208
  • Karma: +5/-0
    • View Profile
    • MilesWeb Internet Services
Mysql - Can't find file: (errno: 13)
« on: December 24, 2013, 08:01:00 AM »
Hello guys,

When opening my site showing following error :

Quote
Can't find file: './your_database_name/myfile_session.frm' (errno: 13) SQL=INSERT INTO `myfile_session` (`session_id`, `client_id`, `time`) VALUES ('adadasdasdasdzc3423sdfs', 0, '2334234234')

This error is occurring due to sometimes there is a permission problem for file.
Login into server via ssh and get root access. Go to mysql directory (/var/lib/mysql/).
Quote
#cd /var/lib/mysql/
Check permission of your_databse_file_name  it has 700 permission and the files under this directory has 660 permission.
The directory and files have the same owner and group (mysql:mysql).

Quote
#ll
drwx------. 2 mysql mysql  4096 Apr  9  2012 your_databse_file_name
Quote
#ll your_databse_file_name

-rw-rw----. 1 mysql mysql   112 Apr  9  2012 stm_users.MYD
-rw-rw----. 1 mysql mysql 15360 Apr  9  2012 stm_users.MYI
-rw-rw----. 1 mysql mysql  8663 Apr  9  2012 stm_user_usergroup_map.frm
-rw-rw----. 1 mysql mysql     9 Apr  9  2012 stm_user_usergroup_map.MYD
-rw-rw----. 1 mysql mysql  2048 Apr  9  2012 stm_user_usergroup_map.MYI
-rw-rw----. 1 mysql mysql 25081 Apr  9  2012 stm_viewlevels.frm
-rw-rw----. 1 mysql mysql    80 Apr  9  2012 stm_viewlevels.MYD
Follow are the command how to change ownership and permission of files.
To change ownership.
Quote
#chown mysql:mysql /var/lib/mysql/your_databse_file_name -R
&
To change permission of files :
Quote
#chmod 700 /var/lib/mysql/your_databse_file_name
and
#chmod 660 /var/lib/mysql/your_databse_file_name/ -R

« Last Edit: May 11, 2015, 12:26:04 PM by Dipak Bhoi »
MilesWeb.com
cPanel Hosting in India - cPanel Hosting in India.

Grab an SSL for your website and SAVE 20% now. Coupon Code SSLSAVE20.

MilesWeb Hosting Forum

Mysql - Can't find file: (errno: 13)
« on: December 24, 2013, 08:01:00 AM »