totn MariaDB

MariaDB: DROP USER statement

This MariaDB tutorial explains how to use the MariaDB DROP USER statement with syntax and examples.

Description

The DROP USER statement is used to remove a user from the MariaDB database.

Syntax

The syntax for the DROP USER statement in MariaDB is:

DROP USER user_name;

Parameters or Arguments

user_name
The name of the user to remove from the MariaDB database.

Example

Let's look at how to drop a user in MariaDB using the DROP USER statement.

For example:

DROP USER 'techonthenet'@'localhost';

In this example, the DROP USER statement would drop the user called techonthenet in the MariaDB database.

Drop more than one user

How can you drop more than one user at a time in MariaDB? You can use the DROP USER statement to drop multiple users by comma separating the users that you wish to drop.

For example:

DROP USER 'techonthenet'@'localhost', 'checkyourmath'@'localhost';

This DROP USER example would drop two users in MariaDB - techonthenet and checkyourmath.