Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need som help with this sql project. In this exercise, you will create two users and a role. You will grant privileges directly to

I need som help with this sql project. In this exercise, you will create two users and a role. You will grant privileges
directly to the first user, but you will grant privileges to the second user by granting
privileges to the role and then assigning the user to that role. In addition, you will
use MySQL Workbench to connect as the two users and test their privileges.
Use MySQL Workbench to connect as the root user.
Write a script that creates a user named ray@localhost with a password
of "temp" that the user must change every 90 days. This user should have
SELECT, INSERT, and UPDATE privileges for the Vendors table of the AP
database; SELECT, INSERT, and UPDATE privileges for the Invoices table;
and SELECT and INSERT privileges for the Invoice_Line_Items table. This
user should also have the right to grant privileges to other users. Run the
script in MySQL Workbench.
Check the privileges for ray@ localhost by using the Users and Privileges
window of MySQL Workbench.
Use MySQL Workbench to create a connection for the user named
ray@ localhost and then connect as that user. Use the Navigator window
to see which databases and tables this user can view.
Run a SELECT statement that selects the vendor_id column for all rows in the
Vendors table. This statement should succeed.
Write a DELETE statement that attempts to delete one of the rows in the
Vendors table. This statement should fail due to insufficient privileges.
Switch back to the tab for the connection for the root user.
Grant the UPDATE privilege for the Invoice_Line_Items table to ray @ local-
host, and give the user the right to grant the same privilege to other users.
Write a script that creates a user named dorothy with a password of "sesame".
Then, create a role named ap_user, and grant this role privileges to select, insert,
and update data from any table in the AP database. However, don't grant this role
privileges to delete any data from the database. Assign the user named dorothy to
this role.
Check the privileges for dorothy by using the SHOW GRANTS statement.
Use MySQL Workbench to create another connection for the user named
dorothy and then connect as that user.
Run a SELECT statement that displays the active roles for the current user. This
should display NONE.
Close the tab for the connection for the user named dorothy, and switch back to
the tab for the connection for the root user.
Set the default role for the user named dorothy to ap_user.
Connect as dorothy again and then display the active roles using the same
statement as in exercise 12. This time, the ap_user role should be displayed.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Probabilistic Databases

Authors: Dan Suciu, Dan Olteanu, Christopher Re, Christoph Koch

1st Edition

3031007514, 978-3031007514

More Books

Students also viewed these Databases questions

Question

a. How do you think these stereotypes developed?

Answered: 1 week ago

Question

7. Describe phases of multicultural identity development.

Answered: 1 week ago