Database Reference
In-Depth Information
To rename a user account, use the
RENAME USER
statement like this:
▼
Input
RENAME USER ben TO bforta;
To delete a user account (along with any associated rights and privileges), use
the
DROP USER
statement as seen here:
▼
Input
DROP USER bforta;
With user accounts created, you must next assign access rights and privileges.
Newly created user accounts have no access at all. They can log in to MariaDB,
but they see no data and cannot perform any database operations.
To see the rights granted to a user account, use
SHOW GRANTS FOR
as seen in
this example:
▼
Input
SHOW GRANTS FOR bforta;
▼
Output
+-------------------------------------------------+
| Grants for bforta@% |
+-------------------------------------------------+
| GRANT USAGE ON *.* TO 'bforta'@'%' |
+-------------------------------------------------+
▼
Analysis
The output shows that user
bforta
has a single right granted,
USAGE ON
*.*
.
USAGE
means
no rights at all
(not overly intuitive, I know), so the results
mean
no rights to anything on any database and any table
.
Note
Users Are Defined As user@host MariaDB privileges are defined using a combination
of user name and hostname. If no hostname is specified then a default hostname of
%
will be used (effectively granting access to the user regardless of the hostname).