MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:March 14 1999 3:13pm
Subject:File access problem
View as plain text  
>>>>> "tymiwi" == tymiwi  <tymiwi@stripped> writes:

>> Description:
tymiwi> Directory layout and permissions on my test system are:

tymiwi> # mysql home
tymiwi> drwxr-x---  12 root     sql          1024 Mar 14 06:18 /home/sql/

tymiwi> # the storage for databasese
tymiwi> drwxr-x---   4 sql      sql          1024 Mar 14 08:28 /home/sql/var/

tymiwi> # all other directories are like this one
tymiwi> drwxr-xr-x   3 root     root         1024 Mar 14 06:14 share

tymiwi> When the server is started with parameter "--user=sql" the following
tymiwi> error appears in error log:

tymiwi> 990314 8:23:48 /data/home/sql/libexec/mysqld: Can't create/write to
tymiwi> file '/home/sql/var/' (Errcode: 13)

tymiwi> My wild guess is that there are some private access checks in your
tymiwi> code which do not work properly (I didn't understand anything from
tymiwi> your source code after being at Finnish USENET meeting and having a
tymiwi> few drinks 8-)

tymiwi> Oh yes, if the server is started from root account it is possible to
tymiwi> change the uid but the process still has priviledged group access
tymiwi> rights. At least I didn't find a way to change the gid. That would be
tymiwi> a good feature to add !

>> How-To-Repeat:

tymiwi> See above.

>> Fix:

tymiwi> Before you say that the permissions are set up weirdly/wrong by me I
tymiwi> must stress that this problem does NOT occur if I start the server
tymiwi> with command:

tymiwi> su sql -c "/home/sql/bin/safe_mysqld --user=sql \
tymiwi> --pid-file=/home/sql/var/"

tymiwi> This is also the quickest way to fix the problem in mysql.server
tymiwi> script...



If you are not running MySQL as root, you should do:

chown -R sql /home/sql/

and everything should work nicely


PS: I have no idea why the 'su' hack works.

File access problemtymiwi14 Mar
  • File access problemMichael Widenius15 Mar
  • Re: File access problemVan15 Mar
    • returning table nameMarc Antony Vose15 Mar
      • returning table namesinisa16 Mar
        • Re: returning table nameThimble Smith16 Mar
Re: File access problemMikael Willberg15 Mar
Re: returning table nameefrazier16 Mar
  • Re: returning table nameThimble Smith16 Mar