THE SQL Server Blog Spot on the Web

Welcome to - The SQL Server blog spot on the web Sign in | |
in Search

Davide Mauri

A place for my thoughts and experiences the Microsoft Data Platform

Wordpress Installation (on IIS and SQL Server)

To proceed with the installation of Wordpress on SQL Server and IIS, first of all, you need to do the following steps

  1. Create a database on SQL Server that will be used by Wordpress
  2. Create login that can access to the just created database and put the user into ddladmin, db_datareader, db_datawriter roles
  3. Download and unpack Wordpress 3.3.2 (latest version as of 27 May 2012) zip file into a directory of your choice
  4. Download the wp-db-abstraction 1.1.4 (latest version as of 27 May 2012) plugin from website

Now that the basic action has been done, you can start to setup and configure your Wordpress installation.

Unpack and follow the instructions in the README.TXT file to install the Database Abstraction Layer. Mainly you have to:

  • Upload wp-db-abstraction.php and the wp-db-abstraction directory to wp-content/mu-plugins.  This should be parallel to your regular plugins directory.  If the mu-plugins directory does not exist, you must create it.
  • Put the db.php file from inside the wp-db-abstraction.php directory to wp-content/db.php

Now you can create an application pool in IIS like the following one


Create a website, using the above Application Pool, that points to the folder where you unpacked Wordpress files.

Be sure to give the “Write” permission to the IIS account, as pointed out in this (old, but still quite valid) installation manual:

Now you’re ready to go. Point your browser to the configured website and the Wordpress installation screen will be there for you.

When you’re requested to enter information to connect to MySQL database, simply skip that page, leaving the default values. If you have installed the Database Abstraction Layer, another database installation screen will appear after the one used by MySQL, and here you can enter the configuration information needed to connect to SQL Server.

After having finished the installation steps, you should be able to access and navigate your wordpress site.  A final touch, and it’s done: just add the needed rewrite rules

and that’s it!


Well. Not really. Unfortunately the current (as of 27 May 2012) version of the Database Abstraction Layer (1.1.4) has some bugs. Luckily they can be quickly fixed:

Backslash Fix

Select Top 0 Fix
Make the change to the file “.\wp-content\mu-plugins\wp-db-abstraction\translations\sqlsrv\translations.php” suggested by “debettap” Winking smile

And now you have a 100% working Wordpress installation on SQL Server!

Since I also wanted to take advantage of SQL Server Full Text Search, I’ve created a very simple wordpress plugin to setup full-text search and to use it as website search engine:


Published Sunday, May 27, 2012 5:14 PM by Davide Mauri
Filed under: , , ,

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS



Davide Mauri said:

In the last months, in the spare time, I started to study PHP in order to use it on a Windows + SQL Server

May 27, 2012 10:15 AM

Brent Ozar said:

WOW!  Things have gotten a lot easier since I tried to pull this off a few years ago.  Nice to see!

June 6, 2012 1:45 PM

Matthew Blott said:

Thanks, this was very useful. The only thing I would add is the user will need to put the appropriate extension in their PHP extensions folder - php_pdo_sqlsrv_52_nts_vc6.dll - in my case (this isn't overly obvious).

One other thing - the "Select Top 0 Fix" link seems to point to something different (unless I am missing something). I've just installed this and aim to migrate our existing Wordpress sites across to SQL Server and don't want to do so if there are any bugs I've  missed.

Thanks again,


July 31, 2012 7:12 AM

Matthew Blott said:

My apologies - just read the second link and it's all there! Note to self - read things properly :-)

July 31, 2012 7:14 AM

rick watson said:

anyone gotten this to work with wordpress 3.4?

November 8, 2012 11:01 AM

Patrick said:

There's a new solution to this problem.  WordPress has been forked to run natively on SQL Server 2012 and SQL Azure.  Http://

June 18, 2013 8:52 AM

Davide Mauri said:

Patrik, that's GREAT!

July 8, 2013 1:47 AM

abx said:


May 31, 2018 11:01 PM

dongdong8 said:



June 29, 2018 3:31 AM

linying123 said:



July 16, 2018 9:23 PM

dongdong8 said:



July 23, 2018 11:43 PM

chenjinyan said:


August 22, 2018 11:16 PM

yanmaneee said:">">

June 29, 2020 11:02 PM

Leave a Comment


About Davide Mauri

Director of Software Development & Cloud Infrastructure @ Sensoria, an innovative smart garments and wearable company. After more than 15 year playing with the Microsoft Data Platform, with a specific focus on High Performance databases, Business Intelligence, Data Science and Data Architectures, he's now applying all his skills to IoT, defining architectures to crunch numbers, create nice user experiences and provide meaningful insights, all leveraging Microsoft Azure cloud. MVP on Data Platform since 2006 he has a very strong background development and love both the ER model and OO principles. He is also a fan of Agile Methodology and Automation, which he tries to apply everywhere he can, to make sure that "people think, machines do".

This Blog


Privacy Statement