[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-users] MySQL or PostGreSQL on RAQ3i



James Montz <jmontz@xxxxxxx> wrote:
> Im using MySQL with PHP on my RAQ3i.  It is working extrememly well.
>
> The only caveat though, is since all the MySQL databases are stored in
> /var/lib/mysql, the size of a hosts database does not count against their
> disk usage.

If you install MySQL from source you can set the data directory as a flag when you
run configure.  This won't help you with file ownership, though.  MySQL data files
are owned by the user that was specified when you installed MySQL.  When installed
from rpm this is likely to be root.  I typically create a non-privileged user "mysql"
and then install MySQL from source with MySQL configured to be owned by "mysql".  You
can still change the ownership of MySQL data files (but not the directories within
the MySQL data directory), but anytime the user creates a new table it will be owned
by the owner of MySQL by default, not that user.  So you will need to monitor the
contents of those directories (actaully this is optional) and change the ownership to
that of the user (you can create a cron job to do this).  Or you can install a
separate MySQL server for each user that will run independently of other "instances"
of MySQL.  If you go this route you'll want to install each instance of MySQL on a
separate port, using separate socket files and owned by the desired user.

> I've thought about creating symlinks back to the sites directories to store
> their databases to solve this problem.  Anyone else tried this or have other
> possible solutions?

You (the server admin) will still have to chown the files b/c they will still be
owned by the user the MySQL server runs as.  And it will be easier for your users to
accidentally delete their database files.  It also doesn't take care of controlling
new tables that are created and you may have MySQL data files spread throughout your
file system, which I personally wouldn't prefer.

Steven Werby {steven-lists@xxxxxxxxxxxx}