> I created a database and then granted an existing user permissions > use to use that database. I then dropped the database. Then, I tried > to revoke the permissions that I had granted. I received an error > that there was no such grant. Is that because dropping a database > also cleans up any permissions associated with that database?
MySQL keeps users and their permissions in a database called mysql. The easiest way to see what's going on is with phyMyAdmin. In the database called mysql there is a user table which holds the names and passwords of all the users who can access any database managed by MySQL on your server. In general the permissions given in the user table apply to all databases, therefore the administrative user has permissions granted there, and normal users have N in all the permission columns of their row in the user table. The db table grants permissions for normal users to use individual databases. This table has one row for each combination of normal user and database, stating the rights that user has on that database. The administrative users that have their rights assigned in the user table do not appear in the db table. So, if the user has a row in the user table, they can connect to the MySQL server. If they have a row in the db table, they can manipulate the database named in that row according to the rights granted in that row. Dropping the named database does NOT imply deleting the row(s) which refer to that database in the db table. So if you have a user joe that has rights to a database foodb, then you drop foodb and create another database with the name foodb, joe will still have the same rights as before. -- Walt _______________________________________________ UPHPU mailing list [email protected] http://uphpu.org/mailman/listinfo/uphpu IRC: #uphpu on irc.freenode.net
