Today I ran into an issue with a demo box that I had used many times before. The SQL Server 2012 install had been installed using an evaluation licence and it had expired. Sharepoint was dead.
The Standard fix for this is to simply run the “Edition upgrade” from the SQL Server Installation Center with a legitimate 2012 key (See this extremely detailed blog post: http://www.mssqlgirl.com/upgrading-from-sql-server-2012-evaluation-edition.html).
Warning: the “ready to upgrade” screen gives no feedback when it’s running. Do NOT cancel it mid-flight, it will complete eventually. I borked my Database by accidentally cancelling it thinking it wasn’t running when it actually was.
However, after the upgrade was complete SQL Server was still dead. Error 40: could not open a connection to SQL server.
Turns out it had stopped the SQL Services required to run your database. After restarting SQL Server (YOURINSTANCENAMEHERE) and SQL Server Agent (YOURINSTANCENAMEHERE) SharePoint was back up and running.