Ошибка 1326 sql server

Ladies & Gentleman,
  • Remove From My Forums
  • Question

  • Ladies & Gentleman,

    my sql server is in a bad status.

    i get error 1326, please tell me what’s the meaning?

Answers

  • Without exact error message it is hard to tell. Especially as the SQL Server error 1326 normally means, that you simply cannot connect to your SQL Server instances. Either cause there is no listener or you there is a firewall blocking the access.

    So rephrase your question, add more information about your context.

    • Marked as answer by

      Tuesday, April 24, 2018 5:43 AM

  • Hi 0bamɑ,

    This is a general error message, could you please share more detailed information to us for analysis?

    As mentioned by Visakh16, this issue is often related to login failed, please check the following items:

    1. If you are using SQL Server Authentication, please check if you have enabled mixed authentication, please go to Properties -> Security page -> Under Server authentication choose the SQL Server and Windows Authentication mode radio button, after that,
    please restart service.

    2. Please check if your account has been enabled in SQL Server.

    3. Please check your password and login name, especially if you are using the alias.

    Best Regards,

    Teige


    MSDN Community Support
    Please remember to click «Mark as Answer» the responses that resolved your issue, and to click «Unmark as Answer» if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to
    MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by
      0bamɑ
      Tuesday, April 24, 2018 5:41 AM

    • Marked as answer by
      0bamɑ
      Tuesday, April 24, 2018 5:43 AM

Stuck with SQL server error 1326? We can help you.

Often SQL server error 1326 pops up when we connect to the SQL server.

Usually, this happens when the IIS Service does not have any rights to use the named pipe.

Here at Bobcares, we often receive requests to solve such SQL errors as part of our Server Management Services.

Today let’s see how our Support Engineers fix this error for our customers.

How to fix SQL server error 1326 on Windows 10?

In order to gain access to Windows NT named pipe, the client must be validated by the Windows NT server

Before going to the steps to fix this error, we will do the basic troubleshooting steps given below:

  • Checking whether named pipe/TCP enabled or not.
  • Remote connections allowed or not.
  • Checking if Windows Firewall is off.
  • Ensuring that there is ping the SQL Server box.
  • Verifying that the SQL Services are running.
  • Checking the port number which the SQL Server is using.

Now let’s see some of the methods that are used by our Support Engineers to fix this:

1. Creating an exception for port 1433 in Windows firewall.

The steps to follow are given below:

1. First, go to Control Panel and click on Windows Firewall

2. From there go to the exception tab.

2. Then we click on Add Port and enter the port number and name.

3. Here we can see the SQL name in the exception tab list.

4. Finally click on the OK button.

2. Enabling mixed authentication.

If we are using the SQL Server Authentication we can enable the mixed authentication for fixing this error.

The steps to follow are given below:

1. First, go to the Properties, then take the Security page under the Server authentication section.

2. Then we will choose the SQL Server and Windows Authentication mode radio button.

3. Finally, we will restart the service.

This will fix the error being faced.

[Still, stuck with the error? We are happy to help you.]

3. Restart MSSQL service.

Sometimes SQL server error 1326 can be fixed by restarting the service.

To restart the service we can do the following steps:

1. First, go to the control panel and open the Local services window.

2. After that we can select the MSSQLSERVER service and restart.

( Or )

1. First, go to Run and give services.msc

2. Then right-click on SQL Server name and select Restart

Conclusion

In short, the SQL server error 1326 has raised because the IIS Service does not have any rights to use the named pipe. Today, we saw the main reason for the SQL error and how our Support Engineers fix it.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = «owonCMyG5nEQ0aD71QM»;

Problem

This technote provides a possible solution to the following error that occurs when attempting to connect to the IBM® Rational® ClearQuest® Microsoft® SQL database:
[][State =01000][Error=1326][Microsoft][ODBC SQL Server Driver]
[SQL Server]"Logon failure: unknown user name or bad password."[
]

Cause

Error 1326 means «Logon failure: unknown user name or bad password.» This error is raised because the IIS Service does not have any rights to use the named pipe.

In order for a client to gain access to a Windows NT named pipe, the client needs to be validated by the Windows NT server. This is normally accomplished through a Workgroups-style validation method where identical usernames and passwords are created on the client and the server, or the domain method where both the client and server are domain members.

The Internet Information Server (IIS) setup process creates a Windows NT ID called IUSR_machinename (where machine name is the name of the Windows NT server), and adds that user to the Guest local group. The IIS service runs under this Windows NT account name.

If the connection to IIS is anonymous, IIS uses the Windows NT account IUSR_machinename and so any network activity performed by IIS is done under this account ID. If the SQL server resides on the same server as IIS, then named pipes connections work and validation is successful. If the SQL server resides on a separate server from IIS, then the IUSR_machinename account needs to be validated on the Windows NT server that SQL resides on.

Resolving The Problem

This account must be verified by the server hosting Microsoft SQL Server in order for the connection to occur properly. If this account is not verified, then the connection fails and provides only the line number in the script file of the attempted connection opening.

To resolve this problem, you can use one of the following options:

  • Enable the Windows NT ID Guest.
  • Make the Windows NT user, IUSR_MachineName, a member of the domain where SQL server resides.
  • Use the account information from Internet Service Manager to set up a local user account on the Windows NT Server that hosts SQL Server.

Related Information

[{«Product»:{«code»:»SSSH5A»,»label»:»Rational ClearQuest»},»Business Unit»:{«code»:»BU053″,»label»:»Cloud & Data Platform»},»Component»:»Database Configuration/Connectivity — SQL Server»,»Platform»:[{«code»:»PF033″,»label»:»Windows»}],»Version»:»2002.05.00;2002.05.20;2003.06.00;2003.06.01;2003.06.10;2003.06.12″,»Edition»:»»,»Line of Business»:{«code»:»LOB45″,»label»:»Automation»}}]

Scenario :

  • The error occurs when trying to connect to a database from a website. 

Cannot connect to Database Server.

Fix 1 :

Basic checks to be done for this error :

  • Named pipe/TCP is enabled.
  • Remote connections are allowed.
  • Windows Firewall is off.
  1.     Try to ping your own computer from another computer. 
  2.     Try disabling firewall / antivirus to arrive at successful pinging.
  3.     Under windows Firewall create an exception for port 1433 as follows:

Go to Control Panel -> Click on Windows Firewall -> Go to exception tab as shown below. 

    

    4.     Click on Add Port… and enter the port number and name.

    5.     Click on Add Program -> Add C:Program FilesMicrosoft SQL Server90Shared locationSQLBrowser.exe in exception list.

    6.     Click ok and save the changes. 

Fix 2 :

Go to control panel -> Open Local services window -> select MSSQLSERVER service and restart.

( Or )

Go to run -> services.msc -> right click on SQL Server name and select “Restart” as shown below :

Fixes are applicable to the following versions of SQL Server:

  • SQL Server 1.1 (16 bit)
  • SQL Server 4.2A (16 bit)
  • SQL Server 4.2B (16 bit)
  • SQL Server 4.21a
  • SQL Server 6.0
  • SQL Server 6.5
  • SQL Server 7.0
  • SQL Server 7.0 OLAP Tools
  • SQL Server 2000
  • SQL Server 2000 64-bit Edition
  • SQL Server 2005
  • SQL Server 2008
  • Azure SQL DB
  • SQL Server 2008 R2
  • SQL Server 2012
  • SQL Server 2014
  • SQL Server 2016

Related Error Tags :

  • i get sql error 1326 when connect to other computer
  • SQL Server 2008 R2 — Cannot Connect Remotely (Error 1326)
  • Resolving could not open a connection to SQL Server errors
  • Error (1326) in SQL Server 2008 R2
  • How do I get this SQL Server ODBC Connection working?
  • SQL Server 2008 — Connection Error 1326
  • Sql Error 1326 : Cannot connect to Database server


Home > SQL Server 2008 > SQL Server 2008 to Windows Server 2008 Connection Error 1326

SQL Server 2008 to Windows Server 2008 Connection Error 1326

SQL Server 2008 to Windows Server 2008 Connection Error 1326

Having installed SQL Server 2008 on a Windows Server 2008 with a firewall, all along I thought it’s just a matter
of allowing SQL Server’s port 1433 in the Windows Firewall to accept incoming connections and everything should be just fine. 
But unfortunately, this was not the case because I was not able to connect to SQL Server.

Windows Firewall on Windows Server 2008 helps prevent unauthorized access to computer resources.  However, if the firewall
is configured incorrectly, which is the case I am in, attempts to connect to an instance of SQL Server may be blocked.  To
access an instance of SQL Server that is behind the firewall, the firewall must be configured on the computer that is running
SQL Server.

After adding SQL Server’s port 1433 to my firewall to accept incoming network connections, I get the following error message:

Cannot connect to 10.10.10.1

Additional Information

A network-related or instance-specific error occurred while establishing a connection to SQL Server.  The server
was not found or was not accessible.  Verify that the instance name is correct and that SQL Server is configured to
allow remote connections.  (provider: Named Pipes Provider, error:40 — Could not open a connection to SQL Server)
(Microsoft SQL Server, Error: 1326).

Automatically Opening the Firewall Port for SQL Server on Windows Server 2008

To fix the problem automatically, download the fix from the following link: Microsoft Fix it 50169. 
Click Run in the File Download dialog box, and then follow the steps in the wizard.  Alternatively, instead of clicking on Run, you may opt to click on Save
to save the file locally before running it.  This may be useful so that you can simply copy the file to all your servers that you want to open the firewall port for SQL Server.

The wizard may be in English only; however, the automatic fix also works for other language versions of Windows.

Reference: How do I open the firewall port for SQL Server on Windows Server 2008?

Manually Opening the Firewall Port for SQL Server on Windows Server 2008

The following script and the procedure in executing the script opens the firewall ports for SQL Server.

To create the script, follow these steps:

  1. Start Notepad.
  2. Copy and paste the following code into Notepad:
    @echo =========  SQL Server Ports  ===================
    @echo Enabling SQLServer default instance port 1433
    netsh firewall set portopening TCP 1433 "SQLServer" 
    @echo Enabling Dedicated Admin Connection port 1434
    netsh firewall set portopening TCP 1434 "SQL Admin Connection" 
    @echo Enabling conventional SQL Server Service Broker port 4022  
    netsh firewall set portopening TCP 4022 "SQL Service Broker" 
    @echo Enabling Transact-SQL Debugger/RPC port 135 
    netsh firewall set portopening TCP 135 "SQL Debugger/RPC" 
    @echo =========  Analysis Services Ports  ==============
    @echo Enabling SSAS Default Instance port 2383
    netsh firewall set portopening TCP 2383 "Analysis Services" 
    @echo Enabling SQL Server Browser Service port 2382
    netsh firewall set portopening TCP 2382 "SQL Browser" 
    @echo =========  Misc Applications  ==============
    @echo Enabling HTTP port 80 
    netsh firewall set portopening TCP 80 "HTTP" 
    @echo Enabling SSL port 443
    netsh firewall set portopening TCP 443 "SSL" 
    @echo Enabling port for SQL Server Browser Service's 'Browse' Button
    netsh firewall set portopening UDP 1434 "SQL Browser" 
    @echo Allowing multicast broadcast response on UDP (Browser Service Enumerations OK)
    netsh firewall set multicastbroadcastresponse ENABLE 
    
  3. Save the file as a .txt file by using the following name: OpenSqlServerPort.txt
  4. Rename the OpenSqlServerPort.txt file to the following: OpenSqlServerPort.bat

Copy the OpenSqlServerPort.bat file to the computer which has the firewall that has the SQL Server 2008 installed and
run the script on that computer.  To run the script, follow these steps:

  1. Click Start, click Run, type cmd, and then click OK.
  2. At the command prompt, use the cd command to navigate to the folder in which you saved the OpenSqlServerPort.bat file.
  3. To run the script, type OpenSqlServerPort.bat at the command prompt, and then press ENTER.

Reference: How do I open the firewall port for SQL Server on Windows Server 2008?

Related Articles :
  • What’s New in SQL Server 2008

bulk upload from csv test file

«servernamewwwrootUploadLDSAgentsMap.txt»

     SET QUOTED_IDENTIFIER ON
SET ANSI_NULLS ON
GO

CREATE PROCEDURE [dbo].[sp_CSVTest_BulkInsert] ( @Path NVARCHAR(128) )
AS 
    DECLARE @Sql NVARCHAR(256)
    SET @Sql = 'BULK
INSERT CSVTest 
FROM ''' + @Path + ''' WITH
(
FIELDTERMINATOR = '','',
ROWTERMINATOR = ''n''
)'
--PRINT @Sql
EXEC(@Sql)

GO

path is «servernamewwwrootUploadLDSAgentsMap.txt»

note

this is in shared hosting and database user have blukadmin and public service role

asked Sep 24, 2010 at 7:54

Surajit's user avatar

SurajitSurajit

5073 gold badges8 silver badges16 bronze badges

This can occur when the Windows user account that SQL runs under (e.g. SqlServerAccount) doesn’t have permissions to access the shared file (servernamewwwrootUploadLDSAgentsMap.txt).

One way we’ve worked through this is to go to the machine where shared file resides. On that machine, add a Windows user account with the same user name and password as the account that SQL runs under.

For example,

If your database resides on MyDatabaseServer, and runs under a Windows user account SqlServerAccount with password Foo, then go to the machine where your shared file resides, e.g. MyFileServer, and create a Windows user account named SqlServerAccount with password Foo.

Last step: go into the folder share on MyFileServer and go into sharing properties for that folder. (On Win7, right-click the folder->Properties->Sharing->Advanced Sharing). Then add read permission for SqlServerAccount that you created.

answered Feb 17, 2011 at 18:31

Judah Gabriel Himango's user avatar

I was getting this error from SSIS when trying to execute a stored procedure which performed a bulk insert.

I fixed it by adding the SQL Server port number to the connection string in SSIS, forcing SSIS to access SQL Server through TCP/IP instead of Named Pipes.

answered Apr 2, 2012 at 16:42

Steve Dowling's user avatar

Steve DowlingSteve Dowling

1,8891 gold badge13 silver badges18 bronze badges

There might be various reasons for above error, but this case is very specific to a situation where SQL Server was installed on a machine which was in Workgroup whereas the backup destination was the server located in the domain.  Here is the error message seen in SQL Agent job history. Let us learn about how to fix Operating system error 1326.

Executed as user: NT ServiceSQLSERVERAGENT. Microsoft (R) SQL Server Execute Package Utility Version 11.0.2100.60
for 64-bit Copyright (C) Microsoft Corporation. All rights reserved.

Started: 12:23:24 PM Progress: 2016-12-27 12:23:25.00 Source: {229AB1E3-E7E5-4185-B305-BF0F7657122A}

Executing query “DECLARE @Guid UNIQUEIDENTIFIER EXECUTE msdb..sp…”.: 100% complete End Progress Error:
2016-12-27 12:23:25.35 Code: 0xC002F210 Source: Back Up Database Task Execute SQL Task

Description: Executing the query “BACKUP DATABASE [master] TO DISK = N’192.168.3….” failed with the following error:
“Cannot open backup device ‘192.168.3.55backupSharemaster_backup_2016_12_27_122325_2407734.bak’.
Operating system error 1326(Logon failure: unknown user name or bad password.).
BACKUP DATABASE is terminating abnormally.”. Possible failure reasons:
Problems with the query, “ResultSet” property not set correctly, parameters not set correctly, or connection
not established correctly.
End Error

Generally, when the backup is taken SQL Agent Service account is used to take backup. In this case since SQL was on Workgroup, it was NT ServiceSQLSERVERAGENT. This account is not a valid account to validate for a domain.

VERIFICAITON

First, let’s verify that we are hitting the same issue which I experienced. From Workgroup machine, we would try to query remote share using xp_cmdshell. Here is the command.

xp_cmdshell 'dir 192.168.3.55backupShare'

This command should fail with below error.

Logon failure: unknown user name or bad password.

SOLUTION

Since we are talking about authentication issue. So, we need to make sure that we map a drive to SQL Server (not windows). As per SQL Server Books-On-Line:

“For a network share to be visible to SQL Server, the share must be mapped as a network drive in the session in which SQL Server is running”

Here is the command to map the drive.

EXEC XP_CMDSHELL 'net use Z: 192.168.3.55backupShare password@123 /User:domainuser'

Once the above is completely successful, we should be able to see content on the Z drive by running below command.

EXEC XP_CMDSHELL 'dir Z:'

After this we should be able to take backup on the Z drive as its mapped within SQL Server as a drive.

Backup database master to disk = 'Z:master.bak'

The above command should work and create the backup file in 192.168.3.55backupShare

Have you encountered this error earlier? Did you find this solution interesting? Please comment and let me know.

Reference: Pinal Dave (https://blog.sqlauthority.com)

First appeared on SQL SERVER – Cannot open backup device. Operating system error 1326 (Logon failure: unknown user name or bad password.)

Tags:

SQL Server

Pinal Dave

Written by Pinal Dave

Pinal Dave is a Microsoft Technology Evangelist (Database and BI). He has written over 1700 articles on the subject on his blog at http://blog.sqlauthority.com. He is a dynamic and proficient Principal Database Architect who specializes in SQL Server Performance Tuning and has 7+ years of hands-on experience. He holds a Masters of Science degree and a number of certifications, including MCTS, MCDBA and MCAD (.NET). He is also Regional Mentor for PASS Asia. Prior to joining Microsoft he was awarded Microsoft MVP award for three continuous years for his contribution in community.

Понравилась статья? Поделить с друзьями:
  • Ошибка 1308 пежо 308
  • Ошибка 1326 litemanager
  • Ошибка 1306 при удалении касперского
  • Ошибка 1324 путь папки содержит недопустимый символ
  • Ошибка 1306 rdp