Jeremy Stein - Brain

« »

DB2 SQL error: SQLCODE: -551, SQLSTATE: 42501

I got this error when the database user account I had created for my application was unable to access a table I had recently created. With DB2, you have to explicitly grant access to each table in the schema, and I hadn’t updated my user’s permissions to grant permission to that one. What a waste of time! Instead, I just went to the control center (DB2 8.1 PE) and changed the user to have the database permission “Database administrator authority”. That’s equivalent to granting dbadm permission, which also gives access to all tables.

Unfortunately, this also gives the user all sorts of extra permission I wouldn’t want him to have (like dropping tables, or worse — creating external routines), but this is just for development, so I’m not worried about it. I wouldn’t recommend this for production configuration (especially for publicly-accessible applications).

September 5, 2006 5 Comments.

5 Comments

  1. Benjamin Stein replied:

    I’m trying to create a table in a schema that doesn’t exist and was just hoping that it would work. But luck is not with me today.

    May 20th, 2009 at 2:54 pm. Permalink.

  2. Murat Knecht replied:

    Thanks, that helped. I also opted for the give-em-all solution. 😉

    Cool captcha btw.

    July 27th, 2009 at 7:14 am. Permalink.

  3. alka panda replied:

    jeremy This post i found very useful for me . I was getting same error on DB2 side. Thanks

    February 24th, 2011 at 6:15 am. Permalink.

  4. sannidhi replied:

    Excellent! Helped me too, thanks much for sharing.

    June 27th, 2011 at 12:59 pm. Permalink.

  5. santosh replied:

    Thanks.It helped greatly.

    October 20th, 2014 at 5:27 pm. Permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

Why ask?

« »