[Mediawiki-l] Many databases, one user.

Jason Walker jnw.walker at gmail.com
Thu Mar 17 15:49:11 UTC 2005


For my project, www.wikigaming.com, I am eventually going to break it
into two or more mediawiki installs but I would like a user to only
have to sign up on one site and have an account on all the others.  I
don't have root access to the host or any way to run a LDAP server, so
I can't do something like that, and I would prefer to not have to
change the code if at all possible (or at least in a minimal way).

I have an elegant solution for a postgreSQL (or mysql 5) install, but
unfortunately, postgre support is still experimental (and my host does
not have pg dbs).  It goes like this:
1) Remove the user table from all databases.
2) Either create a new database (lets call it main) or designate an
existing database to be the main one.
3) Create the user table on the main db.
4) Create views on all other dbs that shadows the main.user table.
This should, unless I'm missing something, work seamlessly.  watchlist
and user_rights would still stay project-dependent... or you could
shadow user_rights in the same way if you want an admin on one project
to be an admin on all projects.  Any comments on if this would work as
planned?

I have also thought about a much less elegant solution for MySQL which
would basically use a brute force method with triggers to update all
user tables whenever one user table changes.  With a lot of users, I
could see this being a major performance hit, though.  Any ideas how
else this could be done in MySQL?

Finally, has anyone written any code to do this very same thing?

-- 
~Jason Walker
Take back the web - Get Firefox!



More information about the MediaWiki-l mailing list