We are excited to announce that the IIS.NET Forums are moving to the new Microsoft Q&A experience. Learn more >

Error establishing a database connection [Answered]RSS

6 replies

Last post May 28, 2011 06:53 PM by simtan

  • Error establishing a database connection

    May 23, 2011 05:40 PM|haymanpl|LINK

     I'm using a copy of my site in webmatrix but not sure how to go about getting the database connected

     

    Any tutorials on how to get this done?  brad   at  Wordpresssites.net

    Error establishing a database connection

  • Re: Error establishing a database connection

    May 24, 2011 01:03 AM|dotnetnerd|LINK

    Could you please advise a bit more? What error message that you got?

  • Re: Error establishing a database connection

    May 24, 2011 04:14 AM|haymanpl|LINK

    Error establishing a database connection

     

    i just opened my backup html folder in webmatrix. i think i need to connect the db? is there a tutorial for opening site backup in webmatrix

  • Re: Error establishing a database connection

    May 24, 2011 04:32 AM|HCamper|LINK

    Hello,

    Yes the error is problem with connection to the SQL Database Server.

    The detail that is required to help further is which Database Server is being used ?

    The steps for Connecting to (Microsoft SQL Server) are not the same as (Connecting to MySQL Server).

    Martin

     

     

    Windows and Linux work Together IT-Pros
    Community Member Award 2011
  • Re: Error establishing a database connection

    May 25, 2011 05:10 AM|Leo Tang - MSFT|LINK

    Hi,

    Normally, the database connection should works without any additional action when opening site backup in webmatrix. In this case, the connection string might be wrong. As Martin mentioned, the detailed information of which database server being used is required.

    If the site use SQL Server Compact database, you can refer to the "Working with Data" section in the following article:

    Introducing WebMatrix
    http://weblogs.asp.net/scottgu/archive/2010/07/06/introducing-webmatrix.aspx

    If it connect to a SQL Server or MySQL Database, you can refer to:

    Connecting to a SQL Server or MySQL Database in WebMatrix
    http://www.asp.net/webmatrix/tutorials/connecting-to-a-sql-server-or-mysql-database-in-webmatrix

    Thanks.

    Please mark the replies as answers if they help or unmark if not.
    Feedback to us


  • Re: Error establishing a database connection

    May 26, 2011 04:18 AM|haymanpl|LINK

     thanks

     

    do i need to download my existing sql database or create a new one?

  • Re: Error establishing a database connection

    May 28, 2011 06:53 PM|simtan|LINK

    Hello,

    What kind of site backup did you restore from? Is it a Wordpress site? If so, you may need to install MySQL. The easiest way to get all the dependencies installed is to try to start a new Site from the App Gallery, choosing Wordpress.

    Otherwise, you may need to create a new database and find a way to get your old data into it. Generally, you can create database backup scripts from your old database that you can then run inside of WebMatrix to populate the new database.

    If you're using the latest versions of Wordpress, I believe there is a mechanism to get a "backup" of your site that you can then use the Wordpress admin interface to "restore" into a new installation.

    Simon Tan
    Program Manager
    Web Platform and Tools