Answered step by step
Verified Expert Solution
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 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 InvoiceLineItems 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 vendorid 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 InvoiceLineItems 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 apuser, 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 apuser.
Connect as dorothy again and then display the active roles using the same
statement as in exercise This time, the apuser role should be displayed.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started