Database Reference
In-Depth Information
mysql --user admin_granter --password=avocet_123
SELECT CURRENT_USER() AS 'User Account';
+-------------------------+
| User Account |
+-------------------------+
| admin_granter@localhost |
+-------------------------+
CREATE USER 'bird_tester'@'localhost';
GRANT SELECT ON birdwatchers.*
TO 'bird_tester'@'localhost';
SHOW GRANTS FOR 'bird_tester'@'localhost';
+---------------------------------------------------------------+
| Grants for bird_tester@localhost |
+---------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'bird_tester'@'localhost' |
| GRANT SELECT ON `birdwatchers`.* TO 'bird_tester'@'localhost' |
+---------------------------------------------------------------+
DROP USER 'bird_tester'@'localhost';
That worked well. We logged in with the
admin_granter@localhost
user account and used
the
CURRENT_USER()
to confirmthe user account. Then we created a user with the
SELECT
privilege on the
birdwatchers
database. We were able to execute
SHOW
GRANTS
to verify this and then successfullyissued
DROP USER
to delete the user ac-
count. We can give this user account to someone on our staff whose responsibility will be
to manage user accounts for ourdatabases.