---
title: "Deleting MySQL Users"
source: "https://docs.nexcess.com/hosting/server-administration/database-management/mariadb-mysql/deleting-mysql-users/"
description: "If you are using MySQL databases with multiple users, you may need to control database access by deleting database users. You can delete MySQL users using eithe…"
vertical: "Hosting"
date: "2024-03-04"
last_modified: "2026-07-27"
---

# Deleting MySQL Users

If you are using MySQL databases with multiple users, you may need to control database access by deleting database users.

You can delete MySQL users using:

- [cPanel](#cPanel)
- [the command line](#CLI)

## Using cPanel to Delete MySQL Users

If you aren’t familiar with using the command line interface, use cPanel to delete MySQL users.

1. Log into your cPanel account for the database’s domain. If you aren’t sure how to access cPanel, read [Getting Started with cPanel](https://docs.nexcess.com/hosting/control-panel/whm/cpanel/getting-started-with-cpanel/) first.
2. Scroll down to the **Databases** section on the cPanel home page and click on **MySQL Databases**. This is where you can create new databases, manage current databases, create users, and manage users.  
    ![mysql databases link highlighted](https://docs.nexcess.com/wp-content/uploads/2026/06/help.liquidweb.com_cAeyuQ.png)
3. Scroll down to the **Current Users** section. Find the user you need to delete and click **Delete**.  
    ![delete highlighted](https://docs.nexcess.com/wp-content/uploads/2026/06/help.liquidweb.com_y8loFc.png)
4. Confirm that you want to delete the user. **Once you delete a user, it cannot be undone!**

[Explore cPanel VPS hosting](https://www.liquidweb.com/vps-hosting/cpanel/)

## Using Command Line to Delete MySQL Users

If you’re comfortable with the command line, it only takes a few minutes to delete MySQL users.

1. Using the terminal program of your choice, log into your server as root. If you haven’t logged into your server using the command line before, read [Logging into Your Server via Secure Shell (SSH)](https://docs.nexcess.com/hosting/server-administration/linux/logging-into-your-server-via-secure-shell-ssh/) first.
2. Log into your MySQL server by typing  
    ```
    mysql -u root -p
    ```
    
      
    The *-u root* flag tells MySQL you want to log in as the root **u**ser, and the *-p* flag prompts MySQL to ask you for a **p**assword. When prompted, enter your root password and press **Enter**.
3. You’ll now see a MySQL prompt that looks like  
    ```
    mysql>
    ```
4. Now you’ll use the *DROP* command to delete a user. Deleting users cannot be undone. In the command prompt, type  
    ```
    DROP USER 'testuser'@'localhost';
    ```
5. Replace “testuser” with the user you’d like to delete.

You’ve successfully deleted a MySQL user!
