无法打开登录请求的数据库 "ASPState"。登录失败。用户 'xxxx' 登录失败
Cannot open database "ASPState" requested by the login. The login failed. Login failed for user 'xxxx'
我正在从事一个项目,该项目采用 Asp.Net 网络表单和 Sql 服务器。当我 运行 应用程序出现错误 Unable to connect Sql Server Session Database
并且内部异常是 Cannot open database ASPState requested by the login
.
我做了一些 google 搜索来解决这个问题。我没有 sa
密码,所以我无法以 sa
身份登录,无法为新创建的用户分配 ASPState 数据库的权限。
我登录时在 Sql 服务器上没有看到任何 ASPState 数据库。所以我想我可能需要在我的机器上 运行 aspnet reg exe。所以我尝试 运行 aspnetreg_regsql.exe 但出现以下错误。
An error occurred during the execution of the SQL file
'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. Change the file path or the file name, and retry the
operation.
创建数据库失败。无法创建列出的某些文件名。检查相关错误。
正在创建 aspnetdb 数据库...
我现在对解决这个问题一无所知,非常感谢您对此的建议。这个问题在生产上发布。
您应该发出命令 DROP DATABASE aspnetdb
然后重新 运行 您的脚本。
'InstallCommon.sql'
肯定不是任何数据库。顾名思义,它必须是安装新数据库的脚本。 运行 脚本,然后 link 生成的数据库
不要认为使用您拥有的权限可以简单地回答这个问题,我认为发生的事情是数据库已经创建,但是您使用的用户没有任何访问权限全部.
如果没有管理员凭据,我认为您无法解决问题。
不过,您可以通过使用不同的名称重新创建数据库来解决此问题:
aspnet_regsql -d[YourNewDBName] -RestOfYourParamaters
这应该允许您重新运行创建脚本,但是不能保证您不会在新创建的数据库上遇到同样的问题。
我正在从事一个项目,该项目采用 Asp.Net 网络表单和 Sql 服务器。当我 运行 应用程序出现错误 Unable to connect Sql Server Session Database
并且内部异常是 Cannot open database ASPState requested by the login
.
我做了一些 google 搜索来解决这个问题。我没有 sa
密码,所以我无法以 sa
身份登录,无法为新创建的用户分配 ASPState 数据库的权限。
我登录时在 Sql 服务器上没有看到任何 ASPState 数据库。所以我想我可能需要在我的机器上 运行 aspnet reg exe。所以我尝试 运行 aspnetreg_regsql.exe 但出现以下错误。
An error occurred during the execution of the SQL file '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. Change the file path or the file name, and retry the operation.
创建数据库失败。无法创建列出的某些文件名。检查相关错误。
正在创建 aspnetdb 数据库...
我现在对解决这个问题一无所知,非常感谢您对此的建议。这个问题在生产上发布。
您应该发出命令 DROP DATABASE aspnetdb
然后重新 运行 您的脚本。
'InstallCommon.sql'
肯定不是任何数据库。顾名思义,它必须是安装新数据库的脚本。 运行 脚本,然后 link 生成的数据库
不要认为使用您拥有的权限可以简单地回答这个问题,我认为发生的事情是数据库已经创建,但是您使用的用户没有任何访问权限全部.
如果没有管理员凭据,我认为您无法解决问题。
不过,您可以通过使用不同的名称重新创建数据库来解决此问题:
aspnet_regsql -d[YourNewDBName] -RestOfYourParamaters
这应该允许您重新运行创建脚本,但是不能保证您不会在新创建的数据库上遇到同样的问题。