Reporting Services 的服务器和数据库连接问题疑难解答Troubleshoot Server & Database Connection Problems with Reporting Services

使用本主题可以排除在连接到报表服务器时所遇到的故障。Use this topic to troubleshoot problems that you experience when connecting to a report server. 本主题还提供了与错误消息有关的信息。This topic also provides information about "Unexpected error" messages. 有关数据源配置和配置报表服务器连接信息的详细信息,请参阅指定报表数据源的凭据和连接信息配置报表服务器数据库连接(报表服务器配置管理器)For more information about data source configuration and configuring report server connection information, see Specify Credential and Connection Information for Report Data Sources and Configure a Report Server Database Connection (Report Server Configuration Manager).

无法与数据源“datasourcename”建立连接。Cannot create a connection to data source 'datasourcename'. (rsErrorOpeningConnection)(rsErrorOpeningConnection)

这是一个一般性错误,在报表服务器无法打开到为报表提供数据的外部数据源的连接时发生。This is a generic error that occurs when the report server cannot open a connection to an external data source that provides data to a report. 此错误和另外一条错误消息一起出现,后者指明了错误的根本原因。This error appears with a second error message that indicates the underlying cause. rsErrorOpeningConnection 一起出现的可能还有以下错误:The following additional errors can appear with rsErrorOpeningConnection.

用户“UserName”登录失败Login failed for user 'UserName'

该用户无权访问该数据源。The user does not have permission to access the data source. 如果使用的是 SQL Server 数据库,请验证该用户是否具有有效的数据库用户登录名。If you are using a SQL Server database, verify that the user has a valid database user login. 有关如何创建数据库用户或 SQL Server 登录名的详细信息,请参阅 创建数据库用户创建 SQL Server 登录名For more information about how to create a database user or a SQL Server login, see Create a Database User and Create a SQL Server Login.

用户“NT AUTHORITY\ANONYMOUS LOGON”登录失败Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'

跨多个计算机连接传递凭据时会发生此错误。This error occurs when credentials are passed across multiple computer connections. 如果使用 Windows 身份验证,并且未启用 Kerberos 5 协议,则在跨多个计算机连接传递凭据时将会出现此错误。If you are using Windows Authentication, and the Kerberos version 5 protocol is not enabled, this error occurs when credentials are passed across more than one computer connection. 若要解除此错误,请考虑使用已存储凭据或提示的凭据。To work around this error, consider using stored credentials or prompted credentials. 有关如何解决此问题的详细信息,请参阅 指定报表数据源的凭据和连接信息For more information about how to work around this issue, see Specify Credential and Connection Information for Report Data Sources.

在建立与服务器的连接时出错。An error has occurred while establishing a connection to the server.

在连接到 SQL Server 时,在默认的设置下 SQL Server 不允许远程连接可能会导致此失败。When connecting to SQL Server, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (提供程序:命名管道提供程序,错误: 40 - 无法打开到 SQL Server 的连接)。(provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server). 此错误由托管报表服务器数据库的数据库引擎实例返回。This error is returned by the instance of the Database Engine that hosts the report server database. 大多数情况下,出现此错误的原因是 SQL Server 服务停止。In most cases, this error occurs because the SQL Server service is stopped. 或者,如果使用的是具有高级服务的 SQL Server Express 或命名实例,那么,当报表服务器 URL 或报表服务器数据库的连接字符串不正确时,将发生此错误。Or, if you are using SQL Server Express with Advanced Services or a named instance, this error will occur if the report server URL or connection string for the report server database is not correct. 若要解决这些问题,请执行以下操作:To work through these issues, do the following:

  • 验证 SQL Server (MSSQLSERVER) 服务是否正在运行。Verify that the SQL Server (MSSQLSERVER) service is started. 在托管数据库引擎实例的计算机上,依次单击“开始”、“管理工具”和“服务”,然后滚动到 SQL Server (MSSQLSERVER)。On the computer that hosts the instance of the Database Engine, click Start, click Administrative Tools, click Services, and scroll to SQL Server (MSSQLSERVER). 如果未启动,请右键单击该服务,选择“属性”,在“启动类型”中选择“自动”,然后依次单击“应用”、“启动”和“确定”。If it is not started, right-click the service, select Properties, in Startup Type select Automatic, click Apply, click Start, and then click OK.
  • 确保报表服务器 URL 和报表服务器数据库连接字符串正确。Verify that the report server URL and report server database connection string is correct. 如果 Reporting Services 或数据库引擎作为命名实例安装,则在安装过程中创建的默认连接字符串将包括相应的实例名称。If Reporting Services or the Database Engine was installed as a named instance, the default connection string that is created during Setup will include the instance name. 例如,如果在名为 DEVSRV01 的服务器上安装了具有高级服务的 SQL Server Express 的默认实例,则 Web 门户 URL 将为 DEVSRV01\Reports$SQLEXPRESS。For example, if you installed a default instance of SQL Server Express with Advanced Services on a server named DEVSRV01, the web portal URL is DEVSRV01\Reports$SQLEXPRESS. 此外,连接字符串中的数据库服务器名称将类似于 DEVSRV01\SQLEXPRESS。Furthermore, the database server name in the connection string will resemble DEVSRV01\SQLEXPRESS. 有关 SQL Server Express 的 URL 和数据源连接字符串的详细信息,请参阅 具有高级服务的 SQL Server Express 中的 Reporting ServicesFor more information about URLs and data source connection strings for SQL Server Express, see Reporting Services in SQL Server Express with Advanced Services. 若要验证报表服务器数据库的连接字符串,请启动 Reporting Services 配置工具并查看“数据库安装”页。To verify the connection string for the report server database, start the Reporting Services Configuration tool and view the Database Setup page.

无法进行连接。A connection cannot be made. 请确保服务器正在运行。Ensure that the server is running.

此错误由 ADOMD.NET 提供程序返回。This error is returned by ADOMD.NET provider. 有多种原因可导致发生此错误。There are several reasons why this error can occur. 如果已将服务器指定为“localhost”,请尝试改为指定服务器名称。If you specified the server as "localhost", try specifying the server name instead. 如果无法为新连接分配内存,也会发生此错误。This error can also occur if memory cannot be allocated to the new connection. 有关详细信息,请参阅 知识库文章 912017 - 连接到 SQL Server 2005 Analysis Services 实例时收到错误消息:For more information, see Knowledge Base Article 912017 - Error message when you connect to an instance of SQL Server 2005 Analysis Services:.

如果此错误还包含“无法识别这种主机”,则说明 Analysis Services 服务器不可用或拒绝连接。If the error also includes "No such host is known", it indicates that the Analysis Services server is not available or is refusing the connection. 如果 Analysis Services 服务器作为命名实例安装在远程计算机上,则可能必须运行 SQL Server Browser 服务来获取该实例使用的端口号。If the Analysis Services server is installed as a named instance on a remote computer, you might have to run the SQL Server Browser service to get the port number used by that instance.

(Report Services SOAP 代理源)(Report Services SOAP Proxy Source)

如果在报表模型生成过程中出现此错误,并且其他信息部分还包含“SQL Server 不存在或访问被拒绝”,则可能是出现了下列情况:If you get this error during report model generation, and the additional information section includes "SQL Server does not exist or access denied", you might be encountering the following conditions:

  • 数据源的连接字符串包含“localhost”。The connection string for the data source includes "localhost".
  • SQL Server 服务禁用 TCP/IP。TCP/IP is disabled for the SQL Server service.

若要解决此错误,您可以将连接字符串修改为使用服务器名称,也可针对服务启用 TCP/IP。To resolve this error, you can either modify the connection string to use the server name or you can enable TCP/IP for the service. 请执行下列步骤启用 TCP/IP:Follow these steps to enable TCP/IP:

  1. 启动 SQL Server 配置管理器。Start SQL Server Configuration Manager.
  2. 展开“SQL Server 网络配置” 。Expand SQL Server Network Configuration.
  3. 选择“MSSQLSERVER 的协议” 。Select Protocols for MSSQLSERVER.
  4. 右键单击“TCP/IP” ,并选择“启用” 。Right-click TCP/IP, and select Enable.
  5. 选择“SQL Server 服务” 。Select SQL Server Services.
  6. 右键单击“SQL Server (MSSQLSERVER)” ,并选择“重新启动” 。Right-click SQL Server (MSSQLSERVER), and select Restart.

在 Management Studio 中连接报表服务器时出现 WMI 错误WMI error when connecting to a report server in Management Studio

默认情况下,Management Studio 使用 Reporting Services Windows Management Instrumentation (WMI) 提供程序来建立与报表服务器的连接。By default, Management Studio uses the Reporting Services Windows Management Instrumentation (WMI) provider to establish a connection to the report server. 如果未正确安装 WMI 提供程序,在尝试连接到报表服务器时将遇到以下错误:If the WMI provider is not installed correctly, you will get the following error when attempting to connect to the report server:

无法连接到 <your server name>。Cannot connect to <your server name>. 没有安装 Reporting Services WMI 提供程序,或者该提供程序配置不当 (Microsoft.SqlServer.Management.UI.RSClient)。The Reporting Services WMI provider is not installed or is misconfigured (Microsoft.SqlServer.Management.UI.RSClient).

若要解决此错误,请重新安装该软件。To resolve this error, you should reinstall the software. 对于所有其他情况,作为临时解决方法,可以通过 SOAP 端点连接到报表服务器:For all other cases, as a temporary work-around, you can connect to the report server through the SOAP endpoint:

  • 在 Management Studio 中的“连接到服务器” 对话框中,在“服务器名称” 中键入报表服务器的 URL。In the Connect to Server dialog box in Management Studio, in Server Name, type the report server URL. 默认为 https://<your server name>/reportserverBy default, it is https://<your server name>/reportserver. 如果使用的是具有高级服务的 SQL Server 2008 Express 版本,则为 https://<your server name>/reportserver$sqlexpressOr if you are using SQL Server 2008 Express with Advanced Services, it is https://<your server name>/reportserver$sqlexpress.

若要解决该错误以便可以使用 WMI 提供程序进行连接,则应运行安装程序以修复 Reporting Services 或重新安装 Reporting Services。To resolve the error so that you can connect using the WMI provider, you should run Setup to repair Reporting Services, or reinstall Reporting Services.

连接错误,由于未知用户名或密码错误导致登录失败Connection error, where login failed due to unknown user name or bad password

如果从报表服务器连接到报表服务器数据库时使用了域帐户,并且更改了该域帐户的密码,则可能会出现 rsReportServerDatabaseLogonFailed 错误。An rsReportServerDatabaseLogonFailed error can occur if you are using a domain account for the connection from the report server to the report server database connection, and the password for the domain account has been changed.

完整错误文本如下:“报表服务器无法打开与报表服务器数据库的连接。The full error text is: "The report server cannot open a connection to the report server database. 登录失败 (rsReportServerDatabaseLogonFailed)。The logon failed (rsReportServerDatabaseLogonFailed). 登录失败: 用户名未知或密码错误。”Logon failure: unknown user name or bad password."

如果重置密码,则必须更新该连接。If you reset the password, you must update the connection. 有关详细信息,请参阅配置报表服务器数据库连接(报表服务器配置管理器)For more information, see Configure a Report Server Database Connection (Report Server Configuration Manager).

报表服务器无法打开与报表服务器数据库的连接。The report server cannot open a connection to the report server database. (rsReportServerDatabaseUnavailable)。(rsReportServerDatabaseUnavailable).

完整消息:报表服务器无法打开与报表服务器数据库的连接。Full Message: The report server cannot open a connection to the report server database. 所有请求和处理都要求与数据库建立连接A connection to the database is required for all requests and processing. (rsReportServerDatabaseUnavailable)(rsReportServerDatabaseUnavailable)
当报表服务器无法连接到为服务器提供内部存储的 SQL Server 关系数据库时,会发生此错误。This error occurs when the report server cannot connect to the SQL Server relational database that provides internal storage to the server. 通过 Reporting Services 配置工具来管理与报表服务器数据库的连接。The connection to the report server database is managed through the Reporting Services Configuration tool. 您可以运行此工具,转到“数据库安装”页,更正连接信息。You can run the tool, go to the Database Setup page, and correct the connection information. 使用此工具更新连接信息是最佳的方法;此工具可确保能够更新相关设置并重新启动服务。Using the tool to update connection information is a best practice; the tool ensures that dependent settings are updated and that services are restarted. 有关详细信息,请参阅 配置报表服务器数据库连接配置报表服务器服务帐户For more information, see Configure a Report Server Database Connection and Configure the Report Server Service Account.

如果没有将托管报表服务器数据库的数据库引擎实例配置为启用远程连接,也会发生此错误。This error can also occur if the Database Engine instance that hosts the report server database is not configured for remote connections. 在某些 SQL Server 版本中,默认情况下将启用远程连接。Remote connection is enabled by default in some editions of SQL Server. 若要验证是否已在你使用的 SQL Server 数据库引擎实例上启用远程连接,请运行 SQL Server 配置管理器工具。To verify whether it is enabled on the SQL Server Database Engine instance you are using, run the SQL Server Configuration Manager tool. 必须同时启用 TCP/IP 和命名管道。You must enable both TCP/IP and named pipes. 报表服务器同时使用这两种协议。A report server uses both protocols. 有关如何启用远程连接的说明,请参阅 配置用于远程管理的报表服务器中的“如何配置与报表服务器数据库的远程连接”部分。For instructions on how to enable remote connections, see the section "How to Configure Remote Connections to the Report Server Database" in Configure a Report Server for Remote Administration.

如果此错误还包含以下文本,则说明用于运行数据库引擎实例的帐户的密码已过期:“与服务器建立连接时出错。If the error includes the following additional text, the password expired on the account used to run the Database Engine instance: "An error has occurred while establishing a connection to the server. 在连接到 SQL Server 时,在默认的设置下 SQL Server 不允许远程连接可能会导致此失败。When connecting to SQL Server, this failure may be caused by the fact that under the default settings SQL Server does not permit remote connections. 提供程序:SQL Server 网络接口,错误:26 - 定位指定的服务器/实例时出错) 。”(provider: SQL Server Network Interfaces, error: 26 - Error Locating Server/Instance Specified)." 若要解决此错误,请重置密码。To resolve this error, reset the password.

“RPC 服务器未在监听”"RPC Server is not listening"

报表服务器服务对某些操作使用远程过程调用 (RPC) 服务器。The Report Server service uses Remote Procedure Call (RPC) server for some operations. 如果遇到“RPC 服务器未在监听”错误,请验证报表服务器服务是否正在运行。If you get the "RPC Server is not listening" error, verify that the Report Server service is running.

错误(常规网络错误)Unexpected error (General network error)

此错误表示数据源连接错误。This error indicates a data source connection error. 您应该查看连接字符串,验证您是否拥有访问该数据源的权限。You should check the connection string, and verify that you have permission to access the data source. 如果使用 Windows 身份验证访问数据源,则必须拥有访问承载该数据源的计算机的权限。If you are using Windows Authentication to access a data source, you must have permission to access the computer that hosts the data source.

无法在 SharePoint 管理中心授予数据库访问权限Unable to grant database access in SharePoint Central Administration

在 Windows Vista 或 Windows Server 2008 上对 Reporting Services 进行配置以便与 SharePoint 产品或技术集成时,尝试在 SharePoint 管理中心的“授予数据库访问权限” 页上授予访问权限时,可能会收到下列错误消息:“无法与计算机建立连接。”When you have configured Reporting Services to integrate with a SharePoint product or technology on Windows Vista or Windows Server 2008, you might receive the following error message when you try to grant access on the Grant Database Access page in SharePoint Central Administration: "A connection to the computer cannot be established."

发生这种情况是因为在执行需要管理员权限的任务时,Windows Vista 和 Windows Server 2008 中的用户帐户控制 (UAC) 要求管理员显式接受才能提升和使用管理员标记。This happens because User Account Control (UAC) in Windows Vista and Windows Server 2008 requires explicit acceptance from an administrator to elevate and use the administrator token when performing tasks that require administrator permissions. 但是在这种情况下,无法提升 Windows SharePoint Services 管理服务来授予 Reporting Services 服务帐户对 SharePoint 配置和内容数据库的访问权限。In this case, however, the Windows SharePoint Services Administration service cannot be elevated to grant the Reporting Services service account or accounts access to the SharePoint configuration and content databases.

在 SQL Server 2008 Reporting Services 中,只有报表服务器服务帐户需要数据库访问权限;在 SQL Server 2005 Reporting Services SP2 中,报表服务器 Windows 服务帐户和报表服务器 Web 服务帐户都要求数据库访问权限。In SQL Server 2008 Reporting Services, only the Report Server service account requires database access; in SQL Server 2005 Reporting Services SP2, both the Report Server Windows service account and the Report Server Web service account require database access. 有关 SQL Server 2008 中的报表服务器服务帐户的详细信息,请参阅服务帐户(Reporting Services 配置)。For more information about the Report Server service account in SQL Server 2008, see Service Account (Reporting Services Configuration).

对于此问题有两种解决方法。There are two workarounds for this issue.

  1. 一种解决方法是:可以暂时关闭 UAC 而使用 SharePoint 管理中心来授予访问权限。In one workaround, you can temporarily turn off UAC and use SharePoint Central Administration to grant access.

重要

如果关闭 UAC 解决此问题要谨慎,在 SharePoint 管理中心授予数据库访问权限后要立即打开 UAC。Use caution if you turn off UAC to work around this issue, and turn on UAC immediately after you grant database access in SharePoint Central Administration. 如果不想关闭 UAC,请使用本节提供的另一种解决方法。If you do not want to turn off UAC, use the second workaround provided in this section. 有关 UAC 的信息,请参阅 Windows 产品文档。For information about UAC, see the Windows product documentation.
2. 第二种解决方法是:可以手动对 Reporting Services 服务帐户授予数据库的访问权限。In the second workaround, you can manually grant database access to the Reporting Services service account or accounts. 可以使用以下过程通过将 Reporting Services 服务帐户添加到正确的 Windows 组和数据库角色来授予访问权限。You can use the following procedure to grant access by adding the Reporting Services service account or accounts to the correct Windows group and database roles. 此过程适用于 SQL Server 2008 Reporting Services 中的报表服务器服务帐户;如果运行 SQL Server 2005 Reporting Services,请为报表服务器 Windows 服务帐户和报表服务器 Web 服务帐户执行此过程。This procedure applies to the Report Server service account in SQL Server 2008 Reporting Services; if you are running SQL Server 2005 Reporting Services, perform the procedure for the Report Server Windows service account and the Report Server Web service account.

手动授予数据库访问权限To manually grant database access

  1. 将报表服务器服务帐户添加到 Reporting Services 计算机上的 WSS_WPG Windows 组。Add the Report Server service account to the WSS_WPG Windows group on the Reporting Services computer.
  2. 连接到承载 SharePoint 配置和内容数据库的数据库实例,为报表服务器服务帐户创建 SQL 数据库登录名。Connect to the database instance that hosts the SharePoint configuration and content databases, and create a SQL database login for the Report Server service account.
  3. 将 SQL 数据库登录名添加到以下数据库角色中:Add the SQL database login to the following database roles:
  • WSS 内容数据库中 db_owner 角色db_owner role in the WSS Content database
  • SharePoint_Config 数据库中 WSS_Content_Application_Pools 角色WSS_Content_Application_Pools role in the SharePoint_Config database

在运行于 Microsoft 群集服务 (MSCS) 群集中的虚拟 SQL Server 上创建报表服务器数据库时,无法连接到 /reports 和 /reportserver 目录Unable to connect to the /reports and /reportserver directories when the report server databases are created on a virtual SQL Server that runs in a Microsoft Cluster Services (MSCS) cluster

在 MSCS 群集中运行的虚拟 SQL Server 上创建报表服务器数据库 ReportServerReportServerTempDB 时,远程名称(格式为 <domain>\<computer_name>$ )可能没有向 SQL Server 注册为登录名。When you create the report server databases, ReportServer and ReportServerTempDB, on a virtual SQL Server that runs in a MSCS cluster, the remote name in the format <domain>\<computer_name>$ might not be registered to SQL Server as a login. 如果将报表服务器服务帐户配置为需要此远程名称才能进行连接的帐户,则用户在 Reporting Services 中无法连接到 /reports 和 /reportserver 目录。If you have configured the Report Server service account as an account that requires this remote name for connections, users cannot connect to the /reports and /reportserver directories in Reporting Services. 例如,内置的 Windows 帐户 NetworkService 要求此远程名称。For example, the built-in Windows account NetworkService requires this remote name. 要避免此问题,请使用显式域帐户或 SQL Server 登录名连接到报表服务器数据库。To avoid this issue, use an explicit domain account or a SQL Server login to connect to the report server databases.

另请参阅See Also

Reporting Services 和 Power View 的浏览器支持Browser Support for Reporting Services and Power View
错误和事件 (Reporting Services)Errors and events (Reporting Services)
排查与 Reporting Services 报表相关的数据检索问题Troubleshoot Data Retrieval issues with Reporting Services Reports
Reporting Services 订阅和传递的疑难解答Troubleshoot Reporting Services Subscriptions and Delivery

是否需要帮助?是否需要帮助? Microsoft 问答StackoverflowSQL Server 产品反馈Need help? Need help? Microsoft Q & A, Stackoverflow, SQL Server product feedback