Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't log into SQL server after changing computer name

Tags:

sql

sql-server

I installed Windows Server 2008 and SQL Server 2008 R2, after joining to domain I changed computer name and mistakenly I deleted the administrators group from SQL Server login users and now I am not able to login.

Any suggestion?

like image 388
Core Avatar asked Feb 29 '12 08:02

Core


People also ask

How do I fix Microsoft SQL Server login failed?

Locate the user that was failing to log in. A x on the user indicates this user has login disabled. To allow the user to login, right-click the user and choose Properties, then click the Status page. Enabling login for the user and click OK.

Can not connect to SQL Server login failed for user?

Right click on the database server and go to properties. Choose the security option and check "SQL Server and Windows authentication mode". Enable TCP/IP connection in SQL Configuration Manager. Restart your SQL server.

How do I reconnect to SQL Server?

To connect to SQL Server: On the File menu, select Connect to SQL Server. If you previously connected to SQL Server, the command name will be Reconnect to SQL Server. In the Server name box, enter or select the name of the instance of SQL Server.

What is the default username and password for SQL Server?

Open the program and choose General → Administration → Settings. Put a mark in UseDB login. Username and Password are default set to AgroSoft and 12345 respectively.


2 Answers

I know this is old but I just used the Gui instead.

Step 1. Start SSMS

Step 2. Select the server name drop down and click browse more.

enter image description here

step 3. select local or network tab based where the server is and expand Database engine and select the correct computer name\sql server enter image description here

like image 173
Train Avatar answered Oct 19 '22 14:10

Train


Follow the steps in this article: http://v-consult.be/2011/05/26/recover-sa-password-microsoft-sql-server-2008-r2/

Basically you have to modify the SQL Server Service settings so that it starts in admin mode. This will only allow one connection to it. Once you start it up you can create a new sysadmin user that you can use from then on.

Also I do know that you need to run certain scripts on a SQL Server if you change the hostname of the server. You should find them if you google them.

like image 22
Tobsey Avatar answered Oct 19 '22 12:10

Tobsey