Bug #30150 Completely unhelpful EACCES (error 13) error message
Submitted: 31 Jul 2007 15:12 Modified: 31 Jul 2007 18:42
Reporter: Norman Gray Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Errors Severity:S4 (Feature request)
Version:Ver 8.41 Distrib 5.0.45 OS:MacOS (10.4.10)
Assigned to: CPU Architecture:Any

[31 Jul 2007 15:12] Norman Gray
Description:
MySQL reports a permissions problem (no write access to datadir directory) as follows:

070731 14:37:38  InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name ./ibdata1
InnoDB: File operation call: 'create'.
InnoDB: Cannot continue operation.

While it's clear some effort has gone into expanding the perror() error message, the result isn't much more helpful than just the error code.  What rights are required?  By which user?  Which directory are we talking about?

How to repeat:
This was produced by trying to start up 'mysqld_safe5' in a situation where the --datadir directory had been created, but had the wrong permissions.  That was because bin/mysql_install_db hadn't yet been run after the installation.

Suggested fix:
Ideally, the message would say

The error means mysqld, running as user <xxx>, does not have the correct access to directory <xxx>, to create file <xxx> (current-directory <xxx>).  The directory <xxx> should have mode <xxx>.

Since this is (I imagine) a generic error message, it might not be possible to generate the suggestions in the second sentence, but the first would always be possible.

If the error message could point to a page of access-permission problems, that might be useful.
[31 Jul 2007 18:42] Sveta Smirnova
Thank you for the reasonable feature request.