May 2005
Intermediate to advanced
352 pages
14h 39m
English
SHOW GRANTS
SHOW GRANTS FOR userThis SQL statement displays the
GRANTS statement for a given user. This is useful
in duplicating an existing user's privileges for
another. If the username is given without reference to a particular
host, the wildcard % is assumed. Otherwise, the
username should be stated with the related host as shown here:
SHOW GRANTS FOR 'russell'@'localhost'\G *************************** 1. row *************************** Grants for russell@localhost: GRANT ALL PRIVILEGES ON *.* TO 'russell'@'localhost' IDENTIFIED BY PASSWORD '1ajk6f3845a1bbca' WITH GRANT OPTION
To reduce clutter, this example is
issued with \G instead of a semicolon to omit
table formatting of the results. Notice that with the exception of
the encrypted password in single quotes, the resulting statement is
what would be entered to create the user russell
for the host localhost, with the given
privileges including the WITH GRANT OPTION flag.
Read now
Unlock full access