简体   繁体   English

无法打开登录请求的数据库“ ASPState”。 登录失败。 用户“ xxxx”的登录失败

[英]Cannot open database “ASPState” requested by the login. The login failed. Login failed for user 'xxxx'

I am working on one project which is in Asp.Net web form and Sql server. 我正在一个项目,它在Asp.Net Web窗体和Sql服务器中。 When I run application I get the error Unable to connect Sql Server Session Database and inner exception is Cannot open database ASPState requested by the login . 当我运行应用程序时,出现错误: Unable to connect Sql Server Session Database ,内部异常是Cannot open database ASPState requested by the login

I did some google search to fix this issue. 我做了一些谷歌搜索来解决这个问题。 I don't have sa password so i cannot logged in as sa to assign privileges to ASPState database for the newly created User. 我没有sa密码,因此无法以sa身份登录以为新创建的User分配权限到ASPState数据库。

I don't see any ASPState database on Sql Server when i logged in. So i thought I might need to run aspnet reg exe on my machine. 登录后,我在Sql Server上没有看到任何ASPState数据库。因此,我认为我可能需要在计算机上运行aspnet reg exe。 So i tried to run aspnetreg_regsql.exe but i got the following error. 所以我尝试运行aspnetreg_regsql.exe,但出现以下错误。

An error occurred during the execution of the SQL file 'InstallCommon.sql'. 执行SQL文件'InstallCommon.sql'时发生错误。 The SQL error number is 5170 and the SqlException message is: Cannot create file 'C:\\Program Files\\Microsoft SQL Server\\MSSQL10_50.MSSQLSERVER\\MSSQL\\DATA\\aspnetdb.mdf' because it already exists. SQL错误号为5170,而SqlException消息为:无法创建文件'C:\\ Program Files \\ Microsoft SQL Server \\ MSSQL10_50.MSSQLSERVER \\ MSSQL \\ DATA \\ aspnetdb.mdf',因为该文件已经存在。 Change the file path or the file name, and retry the operation. 更改文件路径或文件名,然后重试该操作。

CREATE DATABASE failed. CREATE DATABASE失败。 Some file names listed could not be created. 列出的某些文件名无法创建。 Check related errors. 检查相关错误。

Creating the aspnetdb database... 创建aspnetdb数据库...

I am totally blank now to solve this issue, I will really appreciate your suggestion for this. 我现在完全无法解决这个问题,非常感谢您的建议。 This issue hold to publish on production. 此问题暂定在生产中发布。

Dont think that there is a simple answer to this with the permissions that you have, I think that what has happened is that the database HAS been created, but the user you are using does not have any access to it at all. 不要以为您拥有的权限对此有一个简单的答案,我认为发生的事情是已经创建了数据库,但是您使用的用户根本没有访问权限。

Without having an administrators credentials I dont think that you will be able to resolve the problem. 没有管理员的凭据,我认为您将无法解决问题。

You can however work around it by re-creating the database with a different name: 但是,您可以通过使用其他名称重新创建数据库来解决此问题:

aspnet_regsql -d[YourNewDBName] -RestOfYourParamaters

That should allow you to re-run the creation script, however there is no guarantee that you wont end up with the same issue on the newly created database. 那应该允许您重新运行创建脚本,但是不能保证您不会在新创建的数据库上遇到相同的问题。

您应该发出命令DROP DATABASE aspnetdb ,然后重新运行脚本。

'InstallCommon.sql' surely ain't any database. 'InstallCommon.sql'肯定不是任何数据库。 It must be a script that installs a new Database, as the name suggests. 顾名思义,它必须是安装新数据库的脚本。 Run the script, and then link the generated database 运行脚本,然后链接生成的数据库

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法打开登录请求的数据库“ [数据库]”。 登录失败。 用户“ [User]”的登录失败 - Cannot open database “[Database]” requested by the login. The login failed. Login failed for user '[User]" 无法打开登录请求的数据库“身份”。 登录失败。 用户“DESKTOP\User”登录失败 - Cannot open database “Identity” requested by the login. The login failed. Login failed for user 'DESKTOP\User' 无法打开登录请求的数据库“MyBase”。 登录失败。 用户“域\用户”登录失败 - Cannot open database "MyBase" requested by the login. The login failed. Login failed for user 'domain\User' 无法打开登录请求的数据库“ Inventory_New”。 登录失败。 用户“ sa”的登录失败 - Cannot open database “Inventory_New” requested by the login. The login failed. Login failed for user 'sa' 无法打开登录请求的数据库“test”。 登录失败。 用户 'Domain\\userid' 登录失败 - Cannot open database "test" requested by the login. The login failed. Login failed for user 'Domain\userid' 无法打开登录请求的数据库“Test”。 登录失败。 用户'sa'登录失败 - Cannot open database “Test” requested by the login. The login failed. Login failed for user 'sa' 无法打开登录请求的数据库“”。 登录失败。 用户“ sa”的登录失败 - Cannot open database “” requested by the login. The login failed. Login failed for user 'sa' 无法打开登录请求的数据库“databaseName”。登录失败。用户登录失败 - Cannot open database “databaseName" requested by the login. The login failed. Login failed for user 无法打开登录请求的数据库“ dbTest”。 登录失败。 用户“ testUser”的登录失败 - Cannot open database 'dbTest' requested by the login. The login failed. Login failed for user 'testUser' 无法打开登录请求的数据库“测试”。 登录失败。 用户 'xyz\ASPNET' 登录失败 - Cannot open database "test" requested by the login. The login failed. Login failed for user 'xyz\ASPNET'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM