{"id":198,"date":"2014-06-26T07:04:55","date_gmt":"2014-06-26T07:04:55","guid":{"rendered":"http:\/\/dstarena.com\/blog\/?p=198"},"modified":"2017-01-04T09:35:02","modified_gmt":"2017-01-04T09:35:02","slug":"how-to-grant-user-access-to-a-database","status":"publish","type":"post","link":"http:\/\/dstarena.com\/blog\/how-to-grant-user-access-to-a-database\/","title":{"rendered":"How to grant user access to a database?"},"content":{"rendered":"<p style=\"text-align: justify;\">In a database it is very necessary to control the roles of a user; User in a database can have multiple roles. Roles can be either just for accessing the database like reading or writing or it can be read only role as well. The role a user is granted depends on the functionality it performs. Now before creating a database it is necessary to define roles of a user, it helps the dba to understand the users who can access and who cannot access the database.<\/p>\n<p style=\"text-align: justify;\">We use the command &gt;&gt;grant, To grant access to users. We can even identify the users with their name and password. SO, whenever a user wants to link to the database, the user has to connect using username and password.<\/p>\n<p style=\"text-align: justify;\">&gt;&gt;Connect Username\/password.<\/p>\n<p style=\"text-align: justify;\">For e.g.: we create a user by name scott and who can access the database with a password tiger, for this, we write:<\/p>\n<p style=\"text-align: justify;\">&gt;&gt;Connect scott\/tiger;<\/p>\n<p style=\"text-align: justify;\">Or &gt;&gt; connect scott<\/p>\n<p style=\"text-align: justify;\">Password tiger<\/p>\n<p style=\"text-align: justify;\">To create a new user we write the command &gt;&gt;create<\/p>\n<p style=\"text-align: justify;\">&gt;&gt;create user scott identified by tiger;<\/p>\n<p style=\"text-align: justify;\">This creates a user named scott and who can access the database using password tiger.<\/p>\n<p style=\"text-align: justify;\">In order to grant access to the user we write;<\/p>\n<p style=\"text-align: justify;\">&gt;&gt;Grant connect, resource, dba to user 1;<\/p>\n<p style=\"text-align: justify;\">For e.g.;\u00a0 &gt;&gt;grant connect, resource, dba to scott;<\/p>\n<p style=\"text-align: justify;\">Using this granting the user scott can connect to the database, access the resources and access the database as well.<\/p>\n<p style=\"text-align: justify;\">Hit like if you found this post useful.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In a database it is very necessary to control the roles of a user; User in a database can have multiple roles. Roles can be either just for accessing the database like reading or writing or it can be read only role as well. The role a user is granted depends on the functionality it [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[57],"tags":[222,221,224,220,120,223],"class_list":["post-198","post","type-post","status-publish","format-standard","hentry","category-general","tag-command-grant-in-sql","tag-grant-framework","tag-grant-in-sql","tag-grant-user-access","tag-learn-sql","tag-what-is-grant-user-access"],"aioseo_notices":[],"_links":{"self":[{"href":"http:\/\/dstarena.com\/blog\/wp-json\/wp\/v2\/posts\/198","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/dstarena.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/dstarena.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/dstarena.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/dstarena.com\/blog\/wp-json\/wp\/v2\/comments?post=198"}],"version-history":[{"count":3,"href":"http:\/\/dstarena.com\/blog\/wp-json\/wp\/v2\/posts\/198\/revisions"}],"predecessor-version":[{"id":3665,"href":"http:\/\/dstarena.com\/blog\/wp-json\/wp\/v2\/posts\/198\/revisions\/3665"}],"wp:attachment":[{"href":"http:\/\/dstarena.com\/blog\/wp-json\/wp\/v2\/media?parent=198"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/dstarena.com\/blog\/wp-json\/wp\/v2\/categories?post=198"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/dstarena.com\/blog\/wp-json\/wp\/v2\/tags?post=198"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}<!-- WP Super Cache is installed but broken. The constant WPCACHEHOME must be set in the file wp-config.php and point at the WP Super Cache plugin directory. -->