Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create a user with all privileges in Oracle

Tags:

oracle

I was googling about how to create a user and grant all privileges to him.

I found these two methods :

The first method :

create user userName identified by password; grant connect to userName; grant all privileges to userName; 

The second method :

grant connect , resource to userName identified by password; 

So what's the difference between those two methods ?

like image 224
Renaud is Not Bill Gates Avatar asked Mar 13 '14 17:03

Renaud is Not Bill Gates


People also ask

How do I give someone all privileges?

Database-Specific Privileges To GRANT ALL privileges to a user , allowing that user full control over a specific database , use the following syntax: mysql> GRANT ALL PRIVILEGES ON database_name. * TO 'username'@'localhost';

What is grant all privileges in Oracle?

Use the ALL PRIVILEGES privilege type to grant all of the privileges to the user or role for the specified table. You can also grant one or more table privileges by specifying a privilege-list. Use the DELETE privilege type to grant permission to delete rows from the specified table.


1 Answers

There are 2 differences:

2 methods creating a user and granting some privileges to him

create user userName identified by password; grant connect to userName; 

and

grant connect to userName identified by password; 

do exactly the same. It creates a user and grants him the connect role.

different outcome

resource is a role in oracle, which gives you the right to create objects (tables, procedures, some more but no views!). ALL PRIVILEGES grants a lot more of system privileges.

To grant a user all privileges run you first snippet or

grant all privileges to userName identified by password; 
like image 88
Christian13467 Avatar answered Sep 29 '22 04:09

Christian13467