WebMatrix is a great tool for introducing a variety of powerful web platforms to a developer. I decided to check out DotNetNuke and used WebMatrix to install it. Unfortunately, it could not create the database and thus the installation failed. It is using SQLExpress, version 10.0.2531, better named SQL Server 2008 SP1.
This version of SQLExpress ships with Windows authentication only and the sa login disabled. So, prior to installing DotNetNuke using WebMatrix the server must be set up for Mixed Mode authentication and a known password must be given to the sa account. Additionally, when creating a password for the dnnuser account, ensure the password supplied meets the password policy specified in SQL Server. These precautions are easily set using the SQL Server Management Studio, but can also be done via the command line using osql.
Turning on Mixed Mode Authentication is much easier using SQL Server Management Studio, but can also be done by changing the registry as described in the Microsoft Knowledge Base Article 325022 – scroll down to where it reads “Turn on Mixed Mode Authentication after you install MSDE“.
On the machine running SQLExpress and logged in as an administrative account, start a SQL shell with the osql command (in a cmd shell).
C:\> REM -S specifies the server and -E authenticates with your Windows account
C:\> osql -S .\SQLExpress -E
1> -- change the password for the sa account, remember it needs to be complex
2> sp_password @new='P@ssw0rd!', @loginame='sa'
3> go
1> -- an alternative method to change the sa password
2> alter login sa with password = 'P@ssw0rd!'
3> go
1> -- enable the sa account
2> alter login sa enable
3> go
Finally, SQLExpress needs to be restarted. This can be accomplished on the command line, running as a user that has privileges to restart the server.
C:\>runas /user:Administrator "net stop MSSQL$SQLExpress"
Enter the password for Administrator:
Attempting to start net stop MSSQL$SQLExpress as user "COMPUTER\Administrator" ...
C:\>runas /user:Administrator "net start MSSQL$SQLExpress"
Enter the password for Administrator:
Attempting to start net start MSSQL$SQLExpress as user "COMPUTER\Administrator" ...
When this all has successfully completed, start WebMatrix and create the DotNetNuke site. Remember to use the password previously supplied for the sa account and to use a password that meets the policy restrictions enforced on SQL Server, otherwise the database will not be created.