无法使用Sql Server Express在指定的文件夹中创建数据库? [英] Can't create database in a specified folder using Sql Server Express?

查看:128
本文介绍了无法使用Sql Server Express在指定的文件夹中创建数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以在Sql Server完整版中轻松创建数据库,但不能在Sql Server Express中创建数据库,原因似乎是有权访问"指定的文件夹,或者换句话说,该文件夹对于Sql Server似乎是不可见的快递服务.
例如,CREATE DATABASE MYDB
在主计算机上(NAME =``Chan doi vl'',FILENAME =``d:\ MyDb.mdf'')
不会成功执行,并显示诸如"...操作系统错误5(访问被拒绝)..."之类的错误.
我已经为该解决方案搜索了数小时,我想我必须做出一些更改才能使sql server express服务有权访问,但是我不知道该怎么做,如果可以实现,我们可以使用代码(sql声明)来代替使​​用企业管理器?
请帮帮我!
您的所有帮助将不胜感激!
非常感谢!

I can create a database easily in Sql Server Full edition but not in Sql Server Express and the reason seems to be ''right to access'' the specified folder or in other words, that folder seems to be invisible to Sql Server Express services.
For example, CREATE DATABASE MYDB
ON PRIMARY (NAME = ''Chan doi vl'', FILENAME = ''d:\MyDb.mdf'')
will not be successfully executed with an error telling something like ''...operating system error 5 (Access is denied)...''
I have googled for the solution for hours and I guess I have to change something to make sql server express services have right to access but I can''t find out how to do and if that is possibly achieved, can we use code (sql statement) to do that instead of using Enterprise Manager?
Please help me out!
All your helps would be high appreciated!
Thank you very much!

推荐答案

简单:它是一个根文件夹. Vista及更高版本严重限制了在根文件夹中创建文件的权利.更改为子文件夹,您应该没有任何问题.
Simple: it''s a root folder. Vista and above severely restrict the right to create files in the root folder. Change to a subfolder and you should have no such problems.


我找到了自己的解决方案,实际上Express Edition和其他版本之间的访问权限没有区别.我的Sql Server Express服务无法访问本地物理磁盘,因为它们的特权帐户属于网络服务"类型.我将帐户类型更改为本地系统",并且效果很好.您只需要右键单击管理器窗口左侧面板上的服务器名称,选择属性",出现一个新对话框,然后选择登录"标签即可选择所需的帐户类型服务.
I found my own solution, in fact there is no difference about access right between Express Edition and others. My Sql Server Express Services couldn''t access the local physical disks because of their limited-privilege accounts which are type of ''Network service''. I changed the account type to ''Local system'' and it works well. You simply only need to right-click on server name on the left panel in the manager window, select ''Properties'', a new dialogue appears then you select ''Log on'' tab and you can choose the expected type of account for the services.


这篇关于无法使用Sql Server Express在指定的文件夹中创建数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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