Connection to DB failed
Last Post 11/05/2013 7:09 AM by Joseph Craig. 3 Replies.
Author Messages
Donald
Nuke Ace
Nuke Ace
Posts:53


--
11/04/2013 7:00 PM
    Hello

    I am getting ready to migrate a localhost website to a live site. The localhost site is running on SQL Express 2012 LocalDB.

    Following the DNNCreative tutorial, I installed SQL Mgmt Studio Express. I attached the dev site's mdf file then using the Mmgt Studio tools, made a backup. Next I detached the DB and closed Mgmt Studio.

    Afterwards, I attempted to run the localhost site, and DNN reports "connection to DB failed". Hmm.. In an attempt for a quick fix, I deleted all of the files in the localhost site, and copied back in all the files ( I had previously copied all of the files into another folder). Even after this, DNN continues the throw the same error.

    I am clueless about what was changed when I used Management Studio. Any help would be greatly appreciated.

    Thanks
    -DL
    Joseph Craig
    DNN MVP
    Posts:11667


    --
    11/04/2013 9:28 PM
    Is the database on the same server as the website?

    Are there other databases? Can you connect to them? With which method?

    SQL Server needs to be able to accept connections. You need to have the database configured to accept connections, and from the user (and password) you are using or with Windows authentication.

    There probably are a dozen things that could go wrong. Best if you have access to someone who has SQL Server experience. IF you are using a host with tech support, see if they can help you. (Insert ad here for a good company with good tech support and knowledge of DNN!)

    Joe Craig, Patapsco Research Group
    Complete DNN Support
    Donald
    Nuke Ace
    Nuke Ace
    Posts:53


    --
    11/04/2013 10:00 PM
    Hi Joseph
    It is not the live site that has the problem. The localhost site got hosed after attaching it's DB to Mgmt Studio.

    I have several DNN sites on a local computer that I am using for learning, all are using Windows authentication. All sites connect and run (as this one did before attaching to Mgmt Studio). There is single instance of Sql Express installed locally. Each localhost site has its own folder within which is an App_data folder containing database.mdf and database_log.ldf.

    This is a connection problem for sure. Mgmt Studio connects to the local site's DB, but DNN does not. Again, the local site was being used daily for dev with no problems.

    Thanks
    Joseph Craig
    DNN MVP
    Posts:11667


    --
    11/05/2013 7:09 AM
    Have you changed the connection strings in DNN's web.config file so that it points at the SQL Express Server?

    You could also detach file database and see if it will connect with that method.



    Joe Craig, Patapsco Research Group
    Complete DNN Support


    ---