Database Reference
In-Depth Information
Now try to delete the row you added with DELETE , while logged in with the
sakari@localhost user account — not admin_boss . You shouldn't be able to do
that with this user account.
3. While logged into the server as admin_boss , use the REVOKE statement to re-
voke the INSERT and UPDATE privileges from the sakari@localhost user ac-
count you created in the second exercise. When finished, exit MySQL.
Log into MySQL with the sakari@localhost user account. Try to use the INSERT
statement to insert another row in the humans table. You shouldn't be able to do
this. If sakari still has the user privilege, log back into MySQL with admin_boss
and determine what you did wrong when you executed the REVOKE statement
and fix it. Then try again to insert a row using sakari .
4. Log into the server with admin_boss and change the password for the
sakari@localhost user account (this was covered in Changing Passwords and
Names ) . When finished, log out of MySQL.
Log in with sakari , using the new password. Then press the up arrow key on your
keyboard a few times. Check whether you can you see the sakari@localhost pass-
word in one of the entries. If so, this means that other users may also be able to
see the password. Exit MySQL when finished checking.
From the command line using the mysql client on your personal computer —
preferably not on the server — execute the SET statement, using the
PASSWORD() function to get an encrypted password for sakari@localhost . Set a
different password. For an example of how to do this, refer to Changing Pass-
words and Names .
Log into the server with admin_boss and change the password for
sakari@localhost using the encrypted password without the PASSWORD() func-
tion and plain text this time. Then log out and back in as sakari with the new
password. Press the up arrow a few times to see that it shows the new password
encrypted and not in plain text this time.
5. Log into the server with admin_boss and use the DROP USER statement to drop
the sakari@localhost user account. Then log out and try logging in as sakari . You
shouldn't be able to do that.
Search WWH ::




Custom Search