Monday, March 26, 2012

problem with attaching mdf file

Hi,
i installed sql server 2005 express on a windows xp prof. sp2 system.
i also installed the 2005 studio management tool.
I can connect to the sql server (sqlcmd -S), i can create a new database in
the 2005 studio management tool, but i can't attach a mdf file. I'm
administrator so have all rights. I have several mdf (and ldf) files on the
disc.
I did this:
rightclick on Databases, then Attach: i see right an empty windows with an
ADD button.
When i click on that button, i get the error:
c:\myapp\app_data\
cannot access the specified path or file. Verify that you have the necessary
privileges ...
If you know that the service account a specific file, type the path ...
The sevice account is NT AUTHORITY\NetworkService, but when i see the list
of the accounts, i can't find it into that list.
Any help would be appreciated.
Thanks
BobBob wrote:
> Hi,
> i installed sql server 2005 express on a windows xp prof. sp2 system.
> i also installed the 2005 studio management tool.
> I can connect to the sql server (sqlcmd -S), i can create a new database in
> the 2005 studio management tool, but i can't attach a mdf file. I'm
> administrator so have all rights. I have several mdf (and ldf) files on the
> disc.
> I did this:
> rightclick on Databases, then Attach: i see right an empty windows with an
> ADD button.
> When i click on that button, i get the error:
> c:\myapp\app_data\
> cannot access the specified path or file. Verify that you have the necessary
> privileges ...
> If you know that the service account a specific file, type the path ...
> The sevice account is NT AUTHORITY\NetworkService, but when i see the list
> of the accounts, i can't find it into that list.
>
> Any help would be appreciated.
> Thanks
> Bob
>
>
>
>
Create an actual user to be used as the service account, then make sure
that user has read/write permissions in your data directory.
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||Thanks for replying.
Can you tell me how to do that? Do you mean: a windows xp account? And how
to link it to NT AUTHORITY\Network? I can't even find it in the list of the
windows accounts.
"Tracy McKibben" <tracy@.realsqlguy.com> schreef in bericht
news:459BF31D.9050605@.realsqlguy.com...
> Bob wrote:
>> Hi,
>> i installed sql server 2005 express on a windows xp prof. sp2 system.
>> i also installed the 2005 studio management tool.
>> I can connect to the sql server (sqlcmd -S), i can create a new database
>> in the 2005 studio management tool, but i can't attach a mdf file. I'm
>> administrator so have all rights. I have several mdf (and ldf) files on
>> the disc.
>> I did this:
>> rightclick on Databases, then Attach: i see right an empty windows with
>> an ADD button.
>> When i click on that button, i get the error:
>> c:\myapp\app_data\
>> cannot access the specified path or file. Verify that you have the
>> necessary privileges ...
>> If you know that the service account a specific file, type the path ...
>> The sevice account is NT AUTHORITY\NetworkService, but when i see the
>> list of the accounts, i can't find it into that list.
>>
>> Any help would be appreciated.
>> Thanks
>> Bob
>>
>>
>>
> Create an actual user to be used as the service account, then make sure
> that user has read/write permissions in your data directory.
>
> --
> Tracy McKibben
> MCDBA
> http://www.realsqlguy.com|||Thanks for replying.
I copied mydb.mdf and .ldf to the directory where i created a new database,
but in Management Studio, it's the same: i don't see it in the list of the
databases and can't attach it.
"Hari Prasad" <HariPrasad@.discussions.microsoft.com> schreef in bericht
news:7601E1FD-2A85-496E-A92F-06189BC57855@.microsoft.com...
> Easy way is copy the required MDF and LDF files to the default data
> directory
> (The place where you create the new database)
> using the windows explorer and then try attaching the database. This will
> defenetely work out.
> The issue is you have full access to machine but once you login to SQL
> Server you will have access rights only belong to
> account "NT AUTHORITY\NetworkService". The account may not have access to
> folder c:\myapp\app_data\.
> My best suggestion is copy the file to the folder where the new database
> is
> created and attach it.
> Thanks
> Hari
> "Bob" wrote:
>> Hi,
>> i installed sql server 2005 express on a windows xp prof. sp2 system.
>> i also installed the 2005 studio management tool.
>> I can connect to the sql server (sqlcmd -S), i can create a new database
>> in
>> the 2005 studio management tool, but i can't attach a mdf file. I'm
>> administrator so have all rights. I have several mdf (and ldf) files on
>> the
>> disc.
>> I did this:
>> rightclick on Databases, then Attach: i see right an empty windows with
>> an
>> ADD button.
>> When i click on that button, i get the error:
>> c:\myapp\app_data\
>> cannot access the specified path or file. Verify that you have the
>> necessary
>> privileges ...
>> If you know that the service account a specific file, type the path ...
>> The sevice account is NT AUTHORITY\NetworkService, but when i see the
>> list
>> of the accounts, i can't find it into that list.
>>
>> Any help would be appreciated.
>> Thanks
>> Bob
>>
>>
>>
>>|||Bob wrote:
> Thanks for replying.
> Can you tell me how to do that? Do you mean: a windows xp account? And how
> to link it to NT AUTHORITY\Network? I can't even find it in the list of the
> windows accounts.
>
Yes, a Windows XP account or a domain account, whichever is appropriate
for your environment. You don't "link" this new user to NT
AUTHORITY\Network, you'll configure the SQL Server services to run as
the new user that you create. NT AUTHORITY\Network isn't a real user
account.
You could also configure the SQL Server services to run as "Local
System", which will give SQL system-level access to your machine.
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||Thanks it works now
"Tracy McKibben" <tracy@.realsqlguy.com> schreef in bericht
news:459C069B.5080403@.realsqlguy.com...
> Bob wrote:
>> Thanks for replying.
>> Can you tell me how to do that? Do you mean: a windows xp account? And
>> how to link it to NT AUTHORITY\Network? I can't even find it in the list
>> of the windows accounts.
> Yes, a Windows XP account or a domain account, whichever is appropriate
> for your environment. You don't "link" this new user to NT
> AUTHORITY\Network, you'll configure the SQL Server services to run as the
> new user that you create. NT AUTHORITY\Network isn't a real user account.
> You could also configure the SQL Server services to run as "Local System",
> which will give SQL system-level access to your machine.
>
> --
> Tracy McKibben
> MCDBA
> http://www.realsqlguy.com

No comments:

Post a Comment