mediawiki: change db table prefix

Most of the server owners on our virtualmin install are limited to 1 database.

Naturally, I had a user who wants to create 2 instances of mediawiki. This isn’t possible because the installer assumes the table prefix is always “mw_”.

It would be nice to specify the table prefix, of course, so users limited to 1 db could have multiple instances of mediawiki.

I’d be willing to take a crack at the script if you like. It doesn’t look too tough to add another config parm to the perl. The only thing that I’d need help with is figuring out what the current db prefix is (so we can make the conflict check work).

Also, it would be useful to have a brief overview of how this gets run. It’s clear it gets included from somehwere, and I might want to check out some of those subroutines if I run into a bug.

Actually, I think I can fix this right now, I don’t think I need to know the current prefix, based on how find_database_table() is used.

Would you gents be interested in having me send the script updates somewhere to go back into virtualmin?

I also noted what might be a bug in this linee

[code:1] [ "DBschema", "mysql4" ],[/code:1]

Doesn’t look like that will work with postgres installs.

I’ve attached the updated script (which also includes the fix for the versioning issue with php.

Err… tried to anyways [file name=mediawiki.txt size=8127][/file]

Hi kato,

This looks like a good patch, but I’d have to make a similar change in all scripts to be consistent :slight_smile:

Personally, I’d recommend allowing domain owners to create more databases, so that a separate one can be used for used for each mediawiki install. Databases are pretty cheap in MySQL - I know sites that have tens of thousands of databases on a single system.

While this isn’t a large worry or a major headache, it does cramp our plans for hosting a bit, so let me explain our perspective.

We’d like to offer a couple packages, and for the ‘simple’ package to feature a single database, single domain, and 3 email accounts. We think that beginners may be off-put by the idea of managing multiple databases and sites. Additionally, we don’t want to offer too much bang for too little buck–we’d like them to upgrade for more advanced services.

So we’d have to add a constraint that any script only be installed once per client, which works but seems a bit unintuitive–they should be able to put whatever they want into their space, as long as they have space.

Again, not a major selling point, but it is awkward to decide how we’ll word this to make it sound professional. On the flip side, it would encourage upgrading to an advanced package…

You might want to consider limits on disk space rather than the number of databases - in a standard Virtualmin install, the space used by DBs counts against domains’ quotas, so you can relatively safely let users create a large number of DBs.

Just as long as they don’t reach MySQL’s hard-coded upper limit of 32k that is :slight_smile: