Error when trying to connect to SQL database on Install

Post here for help with installing or upgrading mojoPortal pre-compiled release packages. When posting in this forum, please provide all relevant details. You may also want to review the installation or upgrading documentation.

If you have questions about using the source code or working with mojoPortal in Visual Studio, please post in the Developer forum.

Post here for help with installation of mojoPortal pre-compiled release packages

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.

You may also want to review the installation or upgrading documentation.

If you have questions about using the source code or working with mojoPortal in Visual Studio, please post in the Developer forum.

This thread is closed to new posts. You must sign in to post in the forums.
9/12/2010 8:46:29 PM
Gravatar
Total Posts 9

Error when trying to connect to SQL database on Install

When I use the Web Platform Installer, no matter what combination of usernames, passwords and host sites, (localhost, 127.0.0.1), I get the dreaded error, "Cannot connect to database..."  Here is a copy of the relavent error log data;

"[18:43:125]The database 'mojoportal' could not be created.  
Retrying operation 'Add' on object dbFullSql (data source=localhost;initial catalog=mojoportal;user id=sqlUser;pooling=False). Attempt 5 of 5.
    Details:
    originalMessage: The database 'mojoportal' could not be created.
    operationType: Add
    retryAttempt: 5
    retryCount: 5
EXCEPTION: Microsoft.Web.Deployment.DeploymentClientServerException: The database 'mojoportal' could not be created. ---> System.Data.SqlClient.SqlException: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)"

This install is trying to use the username "sqlUser" which is a user account on my machine with Admin privileges, but I also tried the "sa" account with the same results.

Whats going on?

9/13/2010 8:33:23 AM
Gravatar
Total Posts 18439

Re: Error when trying to connect to SQL database on Install

Hi Mark,

The error you posted has nothing to do with users or passwords, it says it can't make a connection to the server.

So either you don't have SQL Server installed on localhost or you have it installed but it is using a named instance and you need to add the instance name as part of the connection string.

For example, by default when you install SQL Express it uses an instance name "SQLExpress" so you need servername\instancename

You should use a connection string in the format suggested

server=localhost\SQLExpress;UID=yoursqluser;PWD=yourpassword;database=yourdbname

When you create the db user you must use a password that meets the default password strength required by SQL Express, an example of a password that meets the criteria is $Secret123 it has at least one special char at least one upper at least one lower and at least one numeric and meets the minium length required.

Hope it helps,

Joe

You must sign in to post in the forums. This thread is closed to new posts.