Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

DB2 database and User Privileges

DZone's Guide to

DB2 database and User Privileges

· Database Zone ·
Free Resource

MariaDB TX, proven in production and driven by the community, is a complete database solution for any and every enterprise — a modern database for modern applications.

IBM DB2 is a family of database server products developed by IBM. Here I was connecting DB2 and WSO2 products. Here I will show how to create users and grant privileges for DB2 users.

Here I have two users. One is 'madhuka' and and second user is 'db2test1'. Madhuka has all the rights (admin). db2test1 is a standard user. I have db2 database called 'regdb7'.

Here I am try to connect to regdb7 from user 'db2test1'.

image

db2test1 user does not have privilege to connect to regdb7.

Now user 'madhuka' (admin) connects to db and gives privileges to db2test1 user.

db2 => connect to regdb7 user madhuka using <password>

image

Here pass user grants

image

Then quit

Now try connect from db2test1

image

Yap, you are in.

You can revoke the permission from

db2=> REVOKE CONNECT ON DATABASE FROM USER db2test1

Here we try it out:

image

Here is full use case that we try:

image

Here is privilege list to try:

[1] http://pic.dhe.ibm.com/infocenter/db2luw/v9r7/index.jsp?topic=%2Fcom.ibm.db2.luw.admin.sec.doc%2Fdoc%2Fc0005478.html


MariaDB AX is an open source database for modern analytics: distributed, columnar and easy to use.

Topics:

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}