SQLExpress数据库文件自动创建错误 [英] SQLExpress database file auto-creation error

查看:117
本文介绍了SQLExpress数据库文件自动创建错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我直接将数据库上传到App_Data文件夹,然后更改了错误.它开始给出一些连接错误.有人请告诉我如何使用ASPNETDB.mdf ???我不知道数据库应该在服务器上自动创建的一件事?还是我应该将创建的mdf文件上传到服务器?这个问题使我的工作停止了三天.


大家好,

每当我运行我的应用程序时,都会出现以下错误.但是在我的本地PC上,它运行良好.我不知道如何解决.有人可以帮我吗?错误是这样的.它正在App_Data文件夹中创建1个mdf文件,但是在服务器上它给出了以下错误.

SQLExpress数据库文件自动创建错误:

连接字符串使用应用程序App_Data目录中的数据库位置指定本地Sql Server Express实例.提供者尝试自动创建应用程序服务数据库,因为提供者确定该数据库不存在.要成功检查应用程序服务数据库的存在并自动创建应用程序服务数据库,必须满足以下配置要求:

如果应用程序App_Data目录尚不存在,则Web服务器帐户必须具有对应用程序目录的读写访问权限.这是必要的,因为Web服务器帐户将自动创建App_Data目录(如果尚不存在).
如果应用程序App_Data目录已经存在,则Web服务器帐户仅需要对应用程序App_Data目录的读写访问权限.这是必需的,因为Web服务器帐户将尝试验证应用程序App_Data目录中是否已存在Sql Server Express数据库.从Web服务器帐户撤消对App_Data目录的读取访问权限,将阻止提供程序正确确定Sql Server Express数据库是否已存在.当提供程序尝试创建已经存在的数据库的副本时,这将导致错误.需要写访问权限,因为在创建新数据库时会使用Web服务器帐户凭据.
必须在计算机上安装Sql Server Express.
Web服务器帐户的进程标识必须具有本地用户配置文件.有关如何为计算机帐户和域帐户创建本地用户配置文件的详细信息,请参见自述文档.

在此先谢谢您.

I uploaded database directly to App_Data folder then error changed. It started giving some connection error. Anybody please tell me how to work with ASPNETDB.mdf??? 1 thing i dont know database should create on server automatically? or I should upload created mdf file to the server?? This problem has stopped my work for last 3 days.


HI all,

whenever I am running my application i am getting following error. But on my local pc its running well. i dont know how to solve it. Anybody can please help me? The error is like this.. It is creating 1 mdf file in App_Data folder but on server its giving following error.

SQLExpress database file auto-creation error:

The connection string specifies a local Sql Server Express instance using a database location within the applications App_Data directory. The provider attempted to automatically create the application services database because the provider determined that the database does not exist. The following configuration requirements are necessary to successfully check for existence of the application services database and automatically create the application services database:

If the applications App_Data directory does not already exist, the web server account must have read and write access to the applications directory. This is necessary because the web server account will automatically create the App_Data directory if it does not already exist.
If the applications App_Data directory already exists, the web server account only requires read and write access to the applications App_Data directory. This is necessary because the web server account will attempt to verify that the Sql Server Express database already exists within the applications App_Data directory. Revoking read access on the App_Data directory from the web server account will prevent the provider from correctly determining if the Sql Server Express database already exists. This will cause an error when the provider attempts to create a duplicate of an already existing database. Write access is required because the web server accounts credentials are used when creating the new database.
Sql Server Express must be installed on the machine.
The process identity for the web server account must have a local user profile. See the readme document for details on how to create a local user profile for both machine and domain accounts.

Thanks in advance.

推荐答案

看起来像一条详细的错误消息.根据其提供的建议,您做了什么尝试对其进行修复?服务器上的用户是否有权创建文件?服务器上的连接字符串正确吗?
Looks like a detailed error message. What have you done to try to fix it, based on the advice it gives ? Does the user on the server have permission to create files ? Is the connection string correct on the server ?


您不理解其中的哪一部分?它告诉您*准确地*需要什么.

0)如果App_Data文件夹尚不存在,则Web服务器帐户需要对Applications文件夹具有读/写访问权限.解决方案-在部署项目之前,在项目中创建App_Data文件夹.

1)如果存在App_Data文件夹,但App_Data文件夹中不存在数据库文件,则Web服务器帐户需要对App_Data文件夹具有读/写访问权限,以便它可以创建数据库.解决方案-在部署数据库之前,先在您的项目中创建数据库.

2)至少,Web服务器帐户需要对App_Data文件夹具有读取访问权限,以便它可以检测数据库文件是否存在.

3)必须在Web服务器计算机上安装Sql Server Express(或更高版本).

4)Web服务器帐户必须具有本地用户配置文件.他们甚至引用了您应该阅读的文档来创建它(如果尚未完成的话).

我假设第2、3和4项不是问题,但是鉴于您对问题的描述缺乏技巧,这真的很难说出来.
What part of that didn''t you understand? It''s telling you *exactly* what is required.

0) The web server account needs read/write access to the Applications folder if the App_Data folder doesn''t already exist. Solution - create the App_Data folder in your project BEFORE you deploy it.

1) If the App_Data folder DOES exist, but the database file doesn''t exist in the App_Data folder, the web server account needs read/write access to the App_Data folder so it can create the database. Solution - create the database in your project BEFORE deploying it.

2) At the very minimum, the web server account needs read access to the App_Data folder so it can detect if the database file exists.

3) Sql Server Express (or higher) must be installed on the web server machine.

4) The web server account must have a local user profile. They even cite the document you should read to create this (if it''s not already done).

I''m assuming that items 2, 3 and 4 are not the issue, but given your lack of descriptive prowess regarding your problem, it''s really hard to tell.


这篇关于SQLExpress数据库文件自动创建错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆