How to Remove a MySQL User using SSH

December 13, 2022 / MySQL

This guide explains how to remove a MySQL user through SSH. The MySQL user is an entry in the USER table of the MySQL server that provides the host information, login information, and account privileges for the MySQL account.

Let us follow a few steps:

  1. Log in to your Server through SSH.
  2. Access MySQL prompt.
  3. Choose the database “MySQL”.
  4. The database name needs to be replaced as shown below.
    mysql> use mysql;
    mysql> DELETE FROM user where user=’mysqltest’;
  5. The username should be changed to the username of the user you want to remove. Additionally, choose the relevant table where the user records are stored. Run this under the root user or a user account with the necessary rights according to the grant tables.

In this manner, you can remove a MySQL user using SSH. If you encounter any issues while doing this you can contact our support staff.

Spread the love