> I must admit I was very curious to read your message when I saw the word
> "jailed" in the subject, and misread it as "Jailed for MySQL hosting" :-)
I was thinking along the lines of "jailed" database setup, where users can
only access their own databases :) Though with recent events...
> Seriously speaking, the feature your are proposing will be useful as I
> imagine many hosting companies will be benefited by it. However, there are
> some practical implementation issues - MySQL is a threaded server, and it
> will be difficult, if not impossible, to make a thread to setuid() to the
> user without wreaking havoc for everyone else. You could, of course,
> create databases as symlinks to the user directory, but everything there
> would have to be owned by MySQL server user.
Permissions shouldn't be a problem, as everything would be owned by the
mysql user like normal. The directories could either be created in the
database store path, as you suggested (I had thought of this myself), as
symlinks to the user's home directory. Even if they were in the user's home
directory, they would still be owned by the mysql user. I see no advantage
to having them in the user's home directory, as quota's work off of uid, and
they couldn't be used with this sort of setup anyway.
Basically, this setup would replace you having to run a separate MySQL
server for each user.
The major issue that came to mind is that the server leaves tables open.
With such a setup, everything would have to be closed when the connection
was closed (or would it?). I haven't worked with the code yet, but it seems
that this would take quite a few changes. Also, I'd think that closing
everything after the connection could cause a serious performance hit.
Perhaps things like PHP's persistant connections would help solve that.
All I'm after here is basically an extension to the namespace. I want two
users to be able to create a database named 'website', without having to run
two separate servers. Hopefully someone can suggest a good solution.