Skip to content

TechDirectArchive

Hands-on IT, Cloud, Security & DevOps Insights

  • Home
  • About
  • Advertise With US
  • Contact
  • Reviews
  • Toggle search form
Home » Oracle/MSSQL/MySQL » How to delete a MySQL User Account
  • Screenshot 2021 03 16 at 21.14.05
    Unable to locate the account: Fix call to DsGetDcNameWithAccount failed with return value 0x0000054B Windows Server
  • aks 1
    Azure Storage: How to create Blob Storage and upload files AWS/Azure/OpenShift
  • image 26
    Add an EBS volume to AWS EC2 via the AWS Console and CLI AWS/Azure/OpenShift
  • sdadsf453423564
    How to download, install and activate, and uninstall IBM SPSS Statistics Mac
  • Fix error Microsoft Outlook cannot sign or encrypt this message when sending email.
    How to fix error “Microsoft Outlook cannot sign or encrypt this message” when sending email? Network | Monitoring
  • Watchguard Firewall 180504 100511 1
    Reset an XTM Firebox Device: Easy Guide Network | Monitoring
  • images 8
    Microsoft Direct Access: Now Always On VPN Windows Server
  • Screenshot
    How to change the Windows Pagefile Size Windows Server

How to delete a MySQL User Account

Posted on 08/04/202325/03/2024 Christian By Christian No Comments on How to delete a MySQL User Account
Drop-or-delete-a-MySQL-user-from-phpmyAdmin

In this article, you will learn how to delete a MySQL User Account. The MySQL user is a record in the USER table of the MySQL server that contains the login information, account privileges, and host information for the MySQL account. Please refer to these related guides: A Review of the VMCE Training and Certification, how to Fix SmartScreen can’t be reached right now on Windows 10 and 11. And how to prevent Exe files from getting deleted randomly in Windows 10 and 11.

It is essential to create a user in MySQL for accessing and managing the databases. To delete a MySQL user is to remove an account and its privileges from all grant tables. Only users with global CREATE USER or DELETE privileges can perform such tasks.

When a MySQL Server installation completes, it comes with a ROOT user account by default which enables you to access and manage the databases.

Most times, you would want to give the database access to others without granting them full control. In that case, you will create a non-root user and grant them specific privileges to access and modify the database. This is the user I will be showing you how to delete.

Please refer to these exciting guides: How to upgrade ManageEngine Password Manager Pro, how to block the Change Password Feature for All Users via the Exchange Administrative Center, and how to use MySQL Workbench to download your MySQL database from Azure to the local computer.

Drop MySQL User Account

I will be showing you how to do this over the phpMyAdmin interface. Basically, these are the same steps to employ when using the command line. Firstly, I will be showing you the USER I would like to drop from the image below.

Delete-mySQL-User1

Next, run the following SQL query to display the user you want to remove by running a command that lists users from the MySQL server.

SELECT User, Host FROM mysql.user;
select-available-users

As you can see below, this is a list of all the available users on this server. To delete a MySQL user via the phpMyAdmin, simply click on the Delete button as shown below.

drop-or-delete-SQL-user

Confirm User Account Deletion

You will be prompted to confirm if you would like to delete the account. Click on Ok to have the MySQL user account deleted.

Please see the related articles. MySQL Workbench could not connect to the MySQL server, How to access MySQL Server from command Prompt and How to import a MySQL Database via the command line.

confirm-delete

See below. The account is no longer available on this MySQL server.

delete-complete

Via the command line

To do this via the command line, locate the name you want to remove. Replace the username in the following command with your user.

DROP USER 'username'@'host';

Remove Multiple MySQL Users

To delete multiple users at the same time. Use the same DROP USER syntax. But this time, add users separated by a comma and a space.

DROP USER 'username1'@'localhost', 'username2'@'localhost', 'username2'@'localhost';

I hope you found this blog post helpful on how to delete a MySQL User Account. If you have any questions, please let me know in the comment section.

Rate this post

Thank you for reading this post. Kindly share it with others.

  • Share on X (Opens in new window) X
  • Share on Reddit (Opens in new window) Reddit
  • Share on LinkedIn (Opens in new window) LinkedIn
  • Share on Facebook (Opens in new window) Facebook
  • Share on Pinterest (Opens in new window) Pinterest
  • Share on Tumblr (Opens in new window) Tumblr
  • Share on Telegram (Opens in new window) Telegram
  • Share on WhatsApp (Opens in new window) WhatsApp
  • Share on Pocket (Opens in new window) Pocket
  • Share on Mastodon (Opens in new window) Mastodon
  • Share on Bluesky (Opens in new window) Bluesky
  • Share on Threads (Opens in new window) Threads
  • Share on Nextdoor (Opens in new window) Nextdoor
Oracle/MSSQL/MySQL Tags:MySQL, MySQL database, MySQL-server, Windows 10, Windows 11, Windows Server 2016

Post navigation

Previous Post: A review of the VMCE training and certification
Next Post: How to check and assign privileges to a MySQL User

Related Posts

  • image 19
    Download your MySQL database from Azure to a local PC with MySQL Workbench AWS/Azure/OpenShift
  • Upgrade the embedded PostgreSQL for Veeam Backup and replication
    How to upgrade PostgreSQL Engine used by VBR Backup
  • Enable or disable SA acocunt
    How to enable an SA account that has been disabled Oracle/MSSQL/MySQL
  • SQL Loves Linux 2 Twitter 002 640x358 1
    Install Microsoft SQL Server 2019 and MSSQL Command line tools on Ubuntu Linux Oracle/MSSQL/MySQL
  • Screenshot 2020 06 22 at 23.27.40 1
    Install MSSQL 2019 Developer Edition and SSMS on Windows Oracle/MSSQL/MySQL
  • How to Fix MS SQL Error 832
    MSSQL Server Error 833: Synthesis of Real-World Case Studies Oracle/MSSQL/MySQL

More Related Articles

image 19 Download your MySQL database from Azure to a local PC with MySQL Workbench AWS/Azure/OpenShift
Upgrade the embedded PostgreSQL for Veeam Backup and replication How to upgrade PostgreSQL Engine used by VBR Backup
Enable or disable SA acocunt How to enable an SA account that has been disabled Oracle/MSSQL/MySQL
SQL Loves Linux 2 Twitter 002 640x358 1 Install Microsoft SQL Server 2019 and MSSQL Command line tools on Ubuntu Linux Oracle/MSSQL/MySQL
Screenshot 2020 06 22 at 23.27.40 1 Install MSSQL 2019 Developer Edition and SSMS on Windows Oracle/MSSQL/MySQL
How to Fix MS SQL Error 832 MSSQL Server Error 833: Synthesis of Real-World Case Studies Oracle/MSSQL/MySQL

Leave a Reply Cancel reply

You must be logged in to post a comment.

Microsoft MVP

VEEAMLEGEND

vexpert-badge-stars-5

Virtual Background

GoogleNews

Categories

veeaam100

sysadmin top30a

  • Screenshot 2021 03 16 at 21.14.05
    Unable to locate the account: Fix call to DsGetDcNameWithAccount failed with return value 0x0000054B Windows Server
  • aks 1
    Azure Storage: How to create Blob Storage and upload files AWS/Azure/OpenShift
  • image 26
    Add an EBS volume to AWS EC2 via the AWS Console and CLI AWS/Azure/OpenShift
  • sdadsf453423564
    How to download, install and activate, and uninstall IBM SPSS Statistics Mac
  • Fix error Microsoft Outlook cannot sign or encrypt this message when sending email.
    How to fix error “Microsoft Outlook cannot sign or encrypt this message” when sending email? Network | Monitoring
  • Watchguard Firewall 180504 100511 1
    Reset an XTM Firebox Device: Easy Guide Network | Monitoring
  • images 8
    Microsoft Direct Access: Now Always On VPN Windows Server
  • Screenshot
    How to change the Windows Pagefile Size Windows Server

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 1,836 other subscribers
  • RSS - Posts
  • RSS - Comments
  • About
  • Authors
  • Write for us
  • Advertise with us
  • General Terms and Conditions
  • Privacy policy
  • Feedly
  • Telegram
  • Youtube
  • Facebook
  • Instagram
  • LinkedIn
  • Tumblr
  • Pinterest
  • Twitter
  • mastodon

Tags

Active Directory AWS Azure Bitlocker Microsoft Windows PowerShell WDS Windows 10 Windows 11 Windows Server 2016

Copyright © 2025 TechDirectArchive

 

Loading Comments...
 

You must be logged in to post a comment.