Tuesday, September 13, 2011

Joomla can't find file jos_session.frm or MySQL Can't read dir (errno: 13)

If you find an Error message containing one of
  1. "Can't find file" ... "jos_session.frm"
  2. MySQL Can't read dir ... (errno: 13)
This is easily Due to:
  1. Incorrect MySQL Directory Ownership
  2. MySQL server Started by Wrong User
To correct this first you need to determine what user is running the MySQL Server by:

ps aux | grep mysql

If you receive a line of output containing the directory where your MySQL process
is Resident you can proceed to change the Ownership.
First select the MySQL Path but "/bin/mysqld", copy it and then paste in this:
Example:
sudo chown -R mysql:mysql yourMySQLBasePathDir

If your path contains also the MySQL version number you should have also a symbolic link from this one to a "mysql" dir and you will need to change ownerships also to this second one.

After you should check you are able to login as mysql user by:
su mysql
If you haven't already set a password you should provide to set it by:
sudo passwd mysql

Now as mysql user you can stop and restart the mysql server:
sudo killall mysqld
yourMySQLBasePathDir/bin/mysqld_safe

No comments:

Post a Comment