To learn more about MariaDB, check this out:
Today, we will explore how we can delete a user in the MariaDB database. The lesser the users, the more secure our database stays. To remove unnecessary users from MariaDB, you only need a simple command and root privileges.”
Following are the steps involved in deleting a user from the MariaDB database:
Step 1: Log in to the MariaDB database instance using your root account
The very first step involves logging into the MariaDB database as the root user. Do that by executing the below-mentioned command:
You can use either of the two commands mentioned above; all up to you.
Step 2: Delete user
Once you are logged in as root, you can easily delete a user. To do that, follow the command below:
Replace user123 with the user you want to delete. After this, the user will be instantly removed. You can then exit the database by running the exit command.
Yes, it is that simple!
In today’s tutorial, we saw in detail how to delete a user from the MariaDB database. All you need is root privilege to delete a user. The process is very straightforward; we ran only 2 commands to show you how to delete a user. Keeping fewer users maintains the security of the database. Make sure you only have the right users on your database and remove the unnecessary ones, as shown in this guide.
We hope you liked our tutorial.