Yes, you certainly needs to chown the files to the specific user id's for
filesystem quota to count the files in the user's quota.
This will solve your quota needs, although I see many potential problems:
- The mysql daemon needs to have access to the files.
An easy solution is to chgrp mysql the files (they should already be) and then
change the permissions so the group has access to them (chmod g+rwx). You
could also use access control list if your system supports it.
- We don't want the users to access the database files directly
If a user owns a file, he can change permissions on it, modify it, delete it,
etc.. The mysql daemon will not like that and it can cause all sorts of
unexpected problems I guess. So the first thing to do is to NOT put the files
in the user's home directory with the symlink hack. This has no advantage and
the users will certainly mess with them if you do so. A complete solution
might be to only chown the files, not their directory. If the user has no
access to the directory, he cannot modify its files even though they are
owned by him.
- Database files are created at various times
You cannot only have a script set the permissions correctly when the database
is created and then forget about it. As the tables will be created, new files
will appear and they need to be chown'ed / chmod'ed. A cron job might come in
handy here.
- innodb tables are different
This should work with myISAM tables, but innodb stores the data in one big
file shared between databases if I am not mistaken. So you need to prevent
your users from using innoDB. May be other table type will have a similar
problem and you might not be able to prevent users from using them. May be
someone more experienced with the different table types available can
enlighten us here.
I never tried such a setup but I will have to soon. Any quirks I missed?
Cedric
Le December 11, 2002 12:06 am, Steven Adams a écrit :
> Well hows it spoes to work with disk qoutas if u dont chown it to the user
> id??
>
> /Steve
> ----- Original Message -----
> From: "Dean Harding" <deanie@stripped>
> To: "'Steven Adams'" <steve@stripped>; <mysql@stripped>
> Sent: Wednesday, December 11, 2002 7:32 AM
> Subject: RE: Quota Support
>
> > Why would you need to chown it? Your user's won't need to touch the
> > file at all, so it should be happy being owned by mysql...
> >
> > I don't know, maybe it won't work... I'm not much of a Unix person -
> > I've never touched unix since I left university :)
> >
> > Dean.
> >
> > > -----Original Message-----
> > > From: Steven Adams [mailto:steve@stripped]
> > > Sent: Tuesday, 10 December 2002 7:42 pm
> > > To: mysql@stripped
> > > Subject: Re: Quota Support
> > >
> > >
> > > So do u mean like this
> > >
> > > user home dir = /home/web/users/xxx
> > >
> > > then u symlink /home/web/users/xxx/mysql/database1 >
> > > /usr/local/mysql/lib/database1
> > >
> > > chown -R xxx.xxx /home/web/users/xxx/mysql/database1
> > >
> > > Wouldent mysql get permissions errors like that?
> > >
> > > /Steve
> > > ----- Original Message -----
> > >
> > > > From: "Dean Harding" <deanie@stripped>
> > > > To: "'Steven Adams'" <steve@stripped>;
> <mysql@stripped>
> > > > Sent: Monday, December 09, 2002 7:01 PM
> > > > Subject: RE: Quota Support
> > > >
> > > > > You can place the actual database files inside your user's home
> > > > > directory, and sym-link to them from the MySQL's data folder.
> >
> > That
> >
> > > way
> > >
> > > > > they will contribute to the user's whole quota and you don't end
> >
> > up
> >
> > > with
> > >
> > > > > one quota for DB and another for everything else.
> > > > >
> > > > > The drawback, of course, is that you have to limit it to one
> user
> >
> > per
> >
> > > > > database (but each user could have more than one database).
> > > > >
> > > > > Dean Harding.
> > > > >
> > > > > > -----Original Message-----
> > > > > > From: Steven Adams [mailto:steve@stripped]
> > > > > > Sent: Monday, 9 December 2002 4:07 pm
> > > > > > To: mysql@stripped
> > > > > > Subject: Quota Support
> > > > > >
> > > > > > Hey,
> > > > > > I was wondering if its possible to implant a quota
> >
> > system
> >
> > > > > where i
> > > > >
> > > > > > can give a user just say access to 2 databases which is
> allowed
> >
> > to
> >
> > > > > grow to
> > > > >
> > > > > > 30Mb bewteen the two of them..
> > > > > >
> > > > > > What i would really like is if its possible to make mysql
> use
> >
> > the
> >
> > > disk
> > >
> > > > > > quota
> > > > > > limits.. So i can give the uses say 50MB WebSpace on my
> server
> >
> > which
> >
> > > > > will
> > > > >
> > > > > > iclude his mysql db
> > > > > >
> > > > > > Thanks
> > > > > > /Steve
> >
> > --------------------------------------------------------------------
> >
> > > -
> > >
> > > > > > Before posting, please check:
> > > > > > http://www.mysql.com/manual.php (the manual)
> > > > > > http://lists.mysql.com/ (the list archive)
> > > > > >
> > > > > > To request this thread, e-mail
> >
> > <mysql-thread126984@stripped>
> >
> > > > > > To unsubscribe, e-mail <mysql-unsubscribe-
> > > > > > deanie=bigpond.net.au@stripped>
> > > > > > Trouble unsubscribing? Try:
> > >
> > > http://lists.mysql.com/php/unsubscribe.php
> > >
> > >
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > Before posting, please check:
> > > http://www.mysql.com/manual.php (the manual)
> > > http://lists.mysql.com/ (the list archive)
> > >
> > > To request this thread, e-mail <mysql-thread127086@stripped>
> > > To unsubscribe, e-mail <mysql-unsubscribe-
> > > deanie=bigpond.net.au@stripped>
> > > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> >
> > ---------------------------------------------------------------------
> > Before posting, please check:
> > http://www.mysql.com/manual.php (the manual)
> > http://lists.mysql.com/ (the list archive)
> >
> > To request this thread, e-mail <mysql-thread127152@stripped>
> > To unsubscribe, e-mail
>
> <mysql-unsubscribe-steve=drifthost.com@stripped>
>
> > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>
> ---------------------------------------------------------------------
> Before posting, please check:
> http://www.mysql.com/manual.php (the manual)
> http://lists.mysql.com/ (the list archive)
>
> To request this thread, e-mail <mysql-thread127184@stripped>
> To unsubscribe, e-mail
> <mysql-unsubscribe-cedric=neopeak.com@stripped> Trouble
> unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php