So I am trying to install MediaWiKi 1.31.0 on a machine running IIS 8 on server 2012 R2. We are running MSSQL server 2012. I followed the instructions on the media wiki page to install for MSSQL, but I get an error when creating the database tables (the last step).

Query: CREATE TABLE [mediawiki].[slots] ( slot_revision_id bigint NOT NULL, slot_role_id smallint NOT NULL CONSTRAINT FK_slots_slot_role FOREIGN KEY REFERENCES slot_roles(role_id), slot_content_id bigint NOT NULL CONSTRAINT FK_slots_content_id FOREIGN KEY REFERENCES content(content_id), slot_origin bigint NOT NULL, CONSTRAINT PK_slots PRIMARY KEY (slot_revision_id, slot_role_id) )

Function: Wikimedia\Rdbms\Database::sourceFile( D:\Web_Apps\TBWiKi/maintenance/mssql/tables.sql ) Error: 1767 [SQLSTATE 42000][Error Code 1767][Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Foreign key 'FK_slots_slot_role' references invalid table 'slot_roles'. [SQLSTATE 42000][Error Code 1750][Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Could not create constraint or index. See previous errors.


0 D:\Web_Apps\TBWiKi\includes\libs\rdbms\database\Database.php(1427): Wikimedia\Rdbms\Database->makeQueryException(string, integer, string, string) 1 D:\Web_Apps\TBWiKi\includes\libs\rdbms\database\Database.php(1200): Wikimedia\Rdbms\Database->reportQueryError(string, integer, string, string, boolean) 2 D:\Web_Apps\TBWiKi\includes\libs\rdbms\database\Database.php(4194): Wikimedia\Rdbms\Database->query(string, string) 3 D:\Web_Apps\TBWiKi\includes\libs\rdbms\database\Database.php(4129): Wikimedia\Rdbms\Database->sourceStream(unknown type, NULL, NULL, string, NULL) 4 D:\Web_Apps\TBWiKi\includes\installer\DatabaseInstaller.php(225): Wikimedia\Rdbms\Database->sourceFile(string) 5 D:\Web_Apps\TBWiKi\includes\installer\DatabaseInstaller.php(248): DatabaseInstaller->stepApplySourceFile(string, string, boolean) 6 D:\Web_Apps\TBWiKi\includes\installer\MssqlInstaller.php(635): DatabaseInstaller->createTables() 7 D:\Web_Apps\TBWiKi\includes\installer\Installer.php(1575): MssqlInstaller->createTables(MssqlInstaller) 8 D:\Web_Apps\TBWiKi\includes\installer\WebInstallerInstall.php(44): Installer->performInstallation(array, array) 9 D:\Web_Apps\TBWiKi\includes\installer\WebInstaller.php(281): WebInstallerInstall->execute() 10 D:\Web_Apps\TBWiKi\mw-config\index.php(79): WebInstaller->execute(array) 11 D:\Web_Apps\TBWiKi\mw-config\index.php(38): wfInstallerMain() 12 {main}

I looked through the table creations SQL script and it's a total joke, there are blatant errors all over the place (references to tables that don't exist, creating foreign keys on tables that are created further down the script...).

So I'm not asking why it's not working, as that's pretty clear. I would like to know if there is a version that doesn't suffer from these..."difficulties"...

Has anyone installed mediawiki successfully on MSSQL?


Citing https://www.mediawiki.org/wiki/Manual:Microsoft_SQL_Server:

Microsoft SQL Server support on MediaWiki is of experimental quality.

So, even if they claim to have some sort of support, it should be clear that if you want to have a reliable production system, you should use MySQL/MariaDB or PostgreSQL.

  • I agree, I was not expecting to have enterprise level support, but I was at least hoping for it to make it past the installer. – Matthew Goulart Jul 30 '18 at 10:28
  • 1
    @MatthewGoulart Since MSSQL is not freely available for testing, changes are typically not tested on it. Feel free to contribute patches (the specific error you have pasted has been fixed on master already, though). – Tgr Jul 31 '18 at 20:26
  • @Tgr MSSQL express is free. Is there some limitation with the express version? I ask because I would be interested in contributing. – Matthew Goulart Jul 31 '18 at 20:33
  • No idea, I'm not familiar with MSSQL. (Seems like there is a more full-featured developer version as well...) The userbase is tiny, there is no CI set up and most developers don't have a test setup; personally I'd prefer not pretending to support it but creating a DDL abstraction layer would also be a viable option. Or someone could set up integration tests for it (if the license allows) and that would prevent syntatically broken patchfiles at least. – Tgr Jul 31 '18 at 21:27
  • @Tgr Just to follow up, even with a clone of the master branch, I still get the error mentioned in my question. – Matthew Goulart Aug 2 '18 at 10:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.