Ask DBMS Expert


Home >> DBMS

Scenario and Summary

MySQL, like many other databases, uses the combination of specific user definitions, privileges, and roles to control access to the data in the database. In turn, it provides various layers of security. When the database is first created, there are several users created for the purpose of not only installing various components of the database, but also to manage and administer the database functionality. You have already used administrative role users in previous labs. In this lab, you will be creating a series of different users, administering various privileges to those users, and exploring how roles help provide additional functionality to the user picture.

It could be achieved in two ways:

1) Using command line to access MySQL directly;

2) Using MySQL Workbench User and Privileges option.

Be sure to save all screenshots on Terminal and MySQL Workbench while executing your SQL code when working on the lab.

Part 1: Using CommandLine on Terminal

a) Add two new users. Grant super user access to one and read-only access to all tables in the database to the second user (Step1, Step 2, and Step 3).

To prove the super-user access for User 1, please write query to SELECT, DELETE, INSERT, UPDATE from any created table and show successful results.

To prove the read-only access for User 2, please write query to SELECT, DELETE, INSERT, UPDATE from any created table. SELECT, DELETE, INSERT, UPDATE from any created table(Note: Only SELECT query will be eligible.)

Sample of commands to check access:

Mysql>show databases; - will list database names;

Mysql>use database name; - Access allowed or denied.

Add screenshots to Report.

b) Modify access of the second user by adding update access to Employee table (Step 4).Add screenshots to Report.

To prove the UPDATE privilege, please login again as User 2 and update COMM column in Employee table.

MYSQL> UPDATE Employee SET COMM = 0.1;

Assignment Step

Description

Step 1

Creating a new user using command line on Terminal

Step 2

Finding information on users

Step 3

Finding user privileges

Step 4

Changing user specifications

Part 2: Using MySQL Workbench

Assignment Step

Description

Step 1

Creating a new user using MySQL Workbench

Step 2

Finding information on users

Step 3

Finding user privileges

Step 4

Changing user specifications. Assigning users to a role

Step 5

Listing privileges associated with a role

Yourlab session, showing any queries, create statements, or other SQL code, and the resulting return from the database--should be placed in a single file called yourname_Lab_3.txt to submit to the Dropbox for the Week 3 iLab.

Note!
This is a difficult assignment to grade, so please combine multiple outputs in a single document in the order of execution. Addition of headings for each step helps clarity. Also, please trim out any errors and unnecessary content.

Part 1: Using command line on Terminal

STEP 1: Creating a new user using command line on Terminal

To start, launch Start,choose MySQL 5.6 Command Line Client - Unicode

Enter password: Enter your password, which you've created during installation;Press Enter;

We'll check the existing users by:

Mysql> select Host, User from mysql.user;

Your response will look like this:
HOST USER
------------------ -----------------------
127.0.0.1 root

Localhost student1

Now, to add new user:

Mysql> CREATE USER ‘username'@'localhost' IDENTIFIED BY ‘password';

Press Enter.

Please note: Username and password are in a single quotes. Statement is ended with semicolon.

Please add before and after screenshots to the Report.

STEP 2:Finding information on users

To verify currently defined users, write and execute the query to display the following information:

Mysql>select Host, User from mysql.user;

And the result set will include a newly created user.

HOST USER
------------------ ---------------
127.0.0.1 root

Localhost student1

Localhost student2

Please add Before and After screenshots to the Report.

STEP 3: Finding User Privileges

Creating a user doesn't give any access to databases.

We have to grant the privileges to the user.

For example, command below grants ‘super user' privileges:

Mysql> GRANT ALL on *.* TO ‘user name'@‘localhost' WITH GRANT OPTION;

Press Enter.

Where ALL - all privileges;

*.* - to all databases, all tables;

Mysql>flush privileges;

Press Enter.

Mysql>quit

To remove user:

Mysql>DROP USER ‘user name'@'localhost'; Press Enter.

To show all users and their privileges:

Mysql>select * from mysqluser;

Press Enter.

To show privileges:

Mysql>show grants for ‘username'@'localhost';

The result set will include grants for user and encrypted password.

Please add Before and After screenshots to the Report.

STEP 4: Changing User Specifications

Command below grants user with UPDATE privilege to Employee table:

Mysql> GRANT UPDATE on *.Employee TO ‘user name'@‘localhost' WITH GRANT OPTION;

Press Enter.

Where

*.Employee - to all databases, Employee table;

Mysql>flush privileges;

Press Enter.

Mysql>quit

To show grants, login again and type command:

Mysql>show grants for ‘username'@'localhost';

The result set will include grants for user and encrypted password.

Please add Before and After screenshots to the Report.

Part 2: Using MySQL Workbench

a) Add twonew users. Grant ‘super user' access to one and read-only access to all tables in the database to the second user (Step1, Step 2, and Step 3).

To prove the super user access for User 1, please write query to SELECT, DELETE, INSERT, UPDATE from any created table and show successful results.

To prove the read-only access for User 2, please write query to SELECT, DELETE, INSERT, UPDATE from any created table. (Note: Only SELECT query will be eligible.DELETE, INSERT, UPDATE will result in an access denied message.)

Add screenshots to Report.

b) Modify access of the second user by adding update access to Employee table (Step 4).

Add screenshots to Report.

To prove the UPDATE privilege, please log in again as User 2 and update COMM column in Employee table.

MYSQL> UPDATE Employee SET COMM = 0.1;

STEP 1: Creating a new user using MySQL Workbench

To start, launch Start,choose MySQL Workbench, Press Enter.

Choose your schema on Home page to connect to MySQL Server.

Enter password; Press OK.

On the left part of the screen,under the Schema, choose your database schema.

Under the Management, click User and Privileges, Enter password to connect to MYSQL Server.

Screen Administration: User and Privileges allows you to add a new user.

Click Add Account button and fill required information in Login screen.

Repeat for the second user.

Please add screenshots to the Report.

STEP 2: Finding information on users.

STEP 3: Finding user privileges.

STEP 5: Listing privileges associated with a role.

Complete Account Limits,Administrative Roles, and Schema Privileges tabs for User 1 and User 2.

Please add screenshots to the Report.

STEP 4: Changing user specifications. Assigning users to a role.

Add UPDATE privilege on Administrative Roles tab for User 2.

Please add screenshots to the Report.

STEP 6: Verifying role content.

Click on Create a new SQL tab for executing query (located on the left corner below the File tab) to start new Query page.

Please prove super user privilege for user 1 by writing and executing SELECT, INSERT, DELETE, UPDATE statements.

To prove the UPDATE privilege for User 2, log in again as User 2 and update COMM column in Employee table.

UPDATE Employee SET COMM = 0.1;

DBMS, Programming

  • Category:- DBMS
  • Reference No.:- M91411899
  • Price:- $60

Priced at Now at $60, Verified Solution

Have any Question?


Related Questions in DBMS

Data mining assignment -in this assignment you are asked to

Data Mining Assignment - In this assignment you are asked to explore the use of neural networks for classification and numeric prediction. You are also asked to carry out a data mining investigation on a real-world data ...

Sql query assignment -for this assignment you are to write

SQL Query Assignment - For this assignment you are to write your answers in a word document. This assignment is in three parts: Part A (reporting queries), Part B (query performance), Part C (query design). For this assi ...

The groceries datasetimagine 10000 receipts sitting on your

The groceries Dataset Imagine 10000 receipts sitting on your table. Each receipt represents a transaction with items that were purchased. The receipt is a representation of stuff that went into a customer's basket. That ...

You are in a real estate business renting apartments to

You are in a real estate business renting apartments to customers. Your job is to define an appropriate schema using SQL DDL in MySQL. The relations are Property(Id, Address, NumberOfUnits), Unit(ApartmentNumber, Propert ...

Objectivethe objective of this lab is to be familiar with a

OBJECTIVE: The objective of this lab is to be familiar with a process in big data modeling. You're required to produce three big data models using the MS PowerPoint software. This tool is available on UMUC Virtual Deskto ...

The relation memberstudentid organizationid roleid stores

The relation Member(StudentId, OrganizationId, RoleId) stores the membership information of student joining organization. For example, ('S1', 'O2', 'R3') indicates that student with Id 'S1' joined the organization with i ...

Relational database exerciseyou have been assigned to a new

Relational Database Exercise: You have been assigned to a new development team. A client is requesting a relational database system to manage their present store with the anticipation of adding more stores in the future. ...

Relational database design a given the following business

Relational Database Design A) Given the following business rules, identify entity types, attributes (at least two attributes for each entity, including the primary key) and relationships, and then draw an Entity-Relation ...

We can represent a data set as a collection of object nodes

We can represent a data set as a collection of object nodes and a collection of attribute nodes, where there is a link between each object and each attribute, and where the weight of that link is the value of the object ...

Data model development and implementationpurpose of the

Data model development and implementation Purpose of the assessment (with ULO Mapping) The purpose of this assignment is to develop data models and map Database System into a standard development environment to gain unde ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As