Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 SQL Server permissions.

Author  Topic 

EDanaII
Starting Member

5 Posts

Posted - 2008-05-10 : 13:47:33
Greetings.

I'm attempting to set up a database on SQL Server Express using PHP (PhpBB3 install) and ODBC on Windows XP (sp3). Whenever I run the software I get the following error:
======================================================================
A fatal and unrecoverable database error has occurred. This may be because the specified user does not have appropriate permissions to CREATE TABLES or INSERT data, etc. Further information may be given below. Please contact your hosting provider in the first instance or the support forums of phpBB for further assistance.

install_install.php [ 1181 ]

SQL : CREATE TABLE [phpbb_attachments] ( [attach_id] [int] IDENTITY (1, 1) NOT NULL , [post_msg_id] [int] DEFAULT (0) NOT NULL , [topic_id] [int] DEFAULT (0) NOT NULL , [in_message] [int] DEFAULT (0) NOT NULL , [poster_id] [int] DEFAULT (0) NOT NULL , [is_orphan] [int] DEFAULT (1) NOT NULL , [physical_filename] [varchar] (255) DEFAULT ('') NOT NULL , [real_filename] [varchar] (255) DEFAULT ('') NOT NULL , [download_count] [int] DEFAULT (0) NOT NULL , [attach_comment] [varchar] (4000) DEFAULT ('') NOT NULL , [extension] [varchar] (100) DEFAULT ('') NOT NULL , [mimetype] [varchar] (100) DEFAULT ('') NOT NULL , [filesize] [int] DEFAULT (0) NOT NULL , [filetime] [int] DEFAULT (0) NOT NULL , [thumbnail] [int] DEFAULT (0) NOT NULL ) ON [PRIMARY]

[Microsoft][SQL Native Client][SQL Server]CREATE TABLE permission denied in database 'master'.
======================================================================

If this were an Oracle database, I'd know what to do. Since this is the first time I've ever messed with MsSQL, I'm not sure exactly where to start.

Any and all clues greatly appreciated.

Ed.

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-05-10 : 14:14:18
Did u check if the user account you use have suffiecient permissions to create table as suggested by the error message.
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-05-10 : 14:28:17
"[Microsoft][SQL Native Client][SQL Server]CREATE TABLE permission denied in database 'master'."

error shows you are creating table in master database.Bad idea. Get necessary permission from SQL server for creating tables in respective database.
Go to Top of Page

EDanaII
Starting Member

5 Posts

Posted - 2008-05-10 : 17:01:13
I know, Sodeep, but as this is a "test run" I'm not terribley worried about where I create it. I will correct it later.

But this is where I'm confused and trying to get this all figured out. If this were Oracle, I'd log into SQL Plus (or similar) and CREATE USER and GRANT CREATE TABLE and all that jazz. I'm not sure what to use for SQL Server Express.


@ visakh16

I'm not sure what account to check. It is running through IIS and, as best I can tell, it is using Windows Authentication with an account called "IUSR_PINKY" and I've no clue how to grant that the proper permisions. As I understand things, I need to map that account to a database account and, once again, I have no clear idea how to do that.

Ed.
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2008-05-10 : 20:45:03
You should create sql login for that account and grant proper permission in user db, never try to test those things in system dbs especially in master db.
Go to Top of Page

EDanaII
Starting Member

5 Posts

Posted - 2008-05-11 : 15:02:25
All right, I found the solution to this. It wasn't SQL Server related but, rather, related to the logon I specified, above. When I switched the user to the Administrator account, everything ran fine. It still created everything in the master account, but I appear to have no control over this. Once again, since this isn't a professional environment, only me playing around on my home computer, I'm not too terribly worried about this.

Probably should check with an IIS forum to see if there is a better way to set this up.

Ed.
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2008-05-11 : 15:51:58
Because windows admin get sysadmin rights by default. You can put user in db_ddladmin role in target db, that wll give user permission to create objects in that db.
Go to Top of Page
   

- Advertisement -