Redigera

Dela via


MSSQLSERVER_18483

Applies to: SQL Server

Details

Attribute Value
Product Name SQL Server
Event ID 18483
Event Source MSSQLSERVER
Component SQLEngine
Symbolic Name REMLOGIN_INVALID_USER
Message Text Could not connect to server '%.ls' because '%.ls' is not defined as a remote login at the server. Verify that you have specified the correct login name. %.*ls.

Explanation

This error occurs when you try to configure a replication distributor on a system that was restored using the hard disk image of another computer where the SQL instance was originally installed. An error message similar to the following is reported to the user:

SQL Server Management Studio could not configure '<Server><Instance>' as the Distributor for '<Server><Instance>' . Error 18483: Could not connect to server '<Server><Instance>' because 'distributor_admin' is not defined as a remote login at the server. Verify that you have specified the correct login name. %.*ls.

Cause

When you deploy SQL Server from a hard disk image of another computer where SQL Server is installed, the network name of the imaged computer is retained in the new installation. The incorrect network name causes the configuration of the replication distributor to fail. The same problem occurs if you rename the computer after SQL Server is installed.

User action

To work around this problem, replace the SQL Server server name with the correct network name of the computer. To do so, follow these steps:

  1. Log on to the computer where you deployed SQL Server from the disk image, and then run the following Transact-SQL statement in SSMS:

    -- Use the Master database
    USE master
    GO
    
    -- Declare local variables
    DECLARE @serverproperty_servername varchar(100),
    @servername varchar(100);
    
    -- Get the value returned by the SERVERPROPERTY system function
    SELECT @serverproperty_servername = CONVERT(varchar(100), SERVERPROPERTY('ServerName'));
    
    -- Get the value returned by @@SERVERNAME global variable
    SELECT @servername = CONVERT(varchar(100), @@SERVERNAME);
    
    -- Drop the server with incorrect name
    EXEC sp_dropserver @server=@servername;
    
    -- Add the correct server as a local server
    EXEC sp_addserver @server=@serverproperty_servername, @local='local';
    
  2. Restart the computer running SQL Server.

  3. To verify that the SQL Server name and the network name of the computer are the same, run the following Transact-SQL statement:

    SELECT @@SERVERNAME, SERVERPROPERTY('ServerName');
    

More information

You can use the @@SERVERNAME global variable or the SERVERPROPERTY('ServerName') function in SQL Server to find the network name of the computer running SQL Server. The ServerName property of the SERVERPROPERTY function automatically reports the change in the network name of the computer when you restart the computer and the SQL Server service. The @@SERVERNAME global variable retains the original SQL Server computer name until the SQL Server name is manually reset.

Steps to Reproduce the Problem

On the computer where you deployed SQL Server from a disk image, follow these steps:

  1. Start Management Studio.

  2. In the Object Explorer, expand your SQL Server instance name.

  3. Right-click on the Replication folder and click Configure distribution Replication, and then click Configure Publishing, Subscribers, and Distribution.

  4. In the Configure Distribution Wizard dialog box, click Next.

  5. In the Distributor dialog box, click to select the '<Server><Instance>' will act as its own Distributor; SQL Server will create a distribution database and log radio button, and then click Next.

  6. In the SQL Server Agent Start dialog box, click Next.

  7. In the Snapshot Folder dialog box, click Next.

    Note

    If you receive a message to confirm the snapshot folder path, click Yes.

  8. In the Distribution Database dialog box, click Next.

  9. In the Publishers dialog box, click Next.

  10. In the Wizard Actions dialog box, click Next.

  11. In the Complete the Wizard dialog box, click Finish.

See also