Skip to content

TechDirectArchive

Hands-on IT, Cloud, Security & DevOps Insights

  • Home
  • About
  • Advertise With US
  • Reviews
  • Contact
  • Toggle search form
Home » Oracle/MSSQL/MySQL » How to check and assign privileges to a MySQL User
  • dism failed errors windows thumbnail 1
    Error 0x800f0830: Discard the modified Image and start again, no operation was performed Windows Server
  • Container insights
    How to use Container Insights for Azure Kubernetes Workload Network | Monitoring
  • Featured image   The Local Device Name is Already in Use
    How to Fix The Local Device Name is Already in Use Windows
  • S3 Bucket Public Access 1
    How to grant public access to S3 Bucket using Policy AWS/Azure/OpenShift
  • PrintNightMare
    Mitigating ‘PrintNightmare’ Vulnerability: Print Spooler Solutions Security | Vulnerability Scans and Assessment
  • Norton RDP
    Can’t connect via RDP upon installing Norton 360 Anti-Virus Solution
  • Delete VM and Storage in Proxmox
    How to delete a VM and Storage in Proxmox Virtualization
  • screenshot 2020 02 08 at 15.53.31
    Enable Automatic Logon on Windows Windows Server

How to check and assign privileges to a MySQL User

Posted on 08/04/202325/03/2024 Christian By Christian No Comments on How to check and assign privileges to a MySQL User
check-and-assign-privileges-to-a-MySQL-User

User management is the process of controlling which users are allowed to connect to the MySQL server. And also, what permissions they are allowed to have on each database. phpMyAdmin does not handle user management, rather it passes the username and password on to the MySQL server which then determines whether a user is permitted to perform a particular action. In this article, you will learn How to check and assign privileges to a MySQL User. Here are some related guides: How to delete a MySQL User Account, What to note when assigning Multiple IPs’ to an Instance.

Within phpMyAdmin, administrators have full control over creating users, viewing and editing privileges for existing users, and removing users.

By default, MySQL installs and works under the root user with all privileges. However, not everyone who accesses the database should have all rights over the data for security reasons.

MySQL provides methods to create new user accounts and grant privileges over the database. A simple command helps provide valuable information about what privileges the users currently have. This tutorial shows you how to check and assign Privileges to a missing Db user on a MySQL server.

Please here are some exciting articles: Error: Access denied to the harddrive and the security tab missing under Active Directory. See how to find the pathname of a mapped network drive, and how to Import PST file into Exchange Server 2016

How to Check Privileges for a User via phpmyAdmin?

Note: Users are assigned to databases by editing the user record from the User accounts link on the phpMyAdmin page. When you edit that user, and remove the privileges The user will disappear from the list of users having access to the database. If you wish to re-assign the privileges to this user, this guide is here to help you.

To check for a user account privilege, you can do this via the command line. And then log into the MySQL server client as root. But in this article, I will be showing you how to do this over the pypMyAdmin interface as shown below.

user-vanished

As you can see, a user I created as a “Teampass Password Manager Database administrator” is missing because I deliberately removed all rights granted to this user. For the net steps to find and re-assign the privileges to these users.

kindly take a look at these related guides: How to migrate Veeam MsSQL Database to a new MsSQL Server, how to migrate Veeam MsSQL Database to a new MsSQL Server, and how to access MySQL Server from command Prompt.

Re-assign the privileges

To fix this, log on to the phpMyAdmin page with your username and password.

Access-PHYmyAdmin-to-assign-priviledges

Select the database in question and click on the SQL query button as shown below

run-sql-query

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;
run-query

The result of the above query is displayed in the image below. To re-assign the privileges, click on the Edit button for this specific user.

show-database-user

The user update privilege table will open upon clicking on the Edit button as shown below. Assign the necessary rights. For me, I will assign all the rights as I want the user to have complete control over the DB. When this is done, the user will be available and accessible to the DB.

Select the privilege you want by selecting the button "Y".
set-mysql-priviledges-to-DB

To manually grant privileges, here are some sample sql statement

UPDATE `user` SET `Grant_priv` = 'Y' WHERE `user`.`User` = 'ur_username' AND `user`.`Host` = '%';

See how to run apps as an administrator on Windows 10 and Windows 11, and how to determine the effect of renaming an MBAM or BitLocker protected Computer.

Revoke all MySQL User Privileges

If you wish to revoke all privileges for a specific user, here is a SQL statement you can use.

REVOKE ALL PRIVILEGES ON . FROM 'ur_username'@'%'; GRANT ALL PRIVILEGES ON . TO 'ur_username'@'%'; ALTER USER 'ur_username'@'%' REQUIRE NONE WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0;

Please refer to these related to learn more about MySQL. How to use MySQL Workbench to download your MySQL database, and MySQL Workbench could not connect to MySQL server.

I hope you found this blog post helpful on how to check and assign privileges to a MySQL User. 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

Post navigation

Previous Post: How to delete a MySQL User Account
Next Post: How to delete and create MySQL Databases

Related Posts

  • Screenshot 2020 06 23 at 10.52.52
    How to uninstall Microsoft SQL Server on Windows Oracle/MSSQL/MySQL
  • oracle q4 earnings are in e28094 but what does it really mean 700x425 1
    How to uninstall Oracle Database 11G or 12c Oracle/MSSQL/MySQL
  • Encryption
    How to encrypt Microsoft SQL Server Traffic Oracle/MSSQL/MySQL
  • How to create and delete MySQL database
    How to delete and create MySQL Databases Oracle/MSSQL/MySQL
  • SQL Error
    Fix “the server was not found or was not accessible: Verify that the instance name is correct and that SQL Server is configured to allow remote connections” Oracle/MSSQL/MySQL
  • installer file too long fix
    Fix long path names to files on SQL Server installation media error Oracle/MSSQL/MySQL

More Related Articles

Screenshot 2020 06 23 at 10.52.52 How to uninstall Microsoft SQL Server on Windows Oracle/MSSQL/MySQL
oracle q4 earnings are in e28094 but what does it really mean 700x425 1 How to uninstall Oracle Database 11G or 12c Oracle/MSSQL/MySQL
Encryption How to encrypt Microsoft SQL Server Traffic Oracle/MSSQL/MySQL
How to create and delete MySQL database How to delete and create MySQL Databases Oracle/MSSQL/MySQL
SQL Error Fix “the server was not found or was not accessible: Verify that the instance name is correct and that SQL Server is configured to allow remote connections” Oracle/MSSQL/MySQL
installer file too long fix Fix long path names to files on SQL Server installation media error 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

  • dism failed errors windows thumbnail 1
    Error 0x800f0830: Discard the modified Image and start again, no operation was performed Windows Server
  • Container insights
    How to use Container Insights for Azure Kubernetes Workload Network | Monitoring
  • Featured image   The Local Device Name is Already in Use
    How to Fix The Local Device Name is Already in Use Windows
  • S3 Bucket Public Access 1
    How to grant public access to S3 Bucket using Policy AWS/Azure/OpenShift
  • PrintNightMare
    Mitigating ‘PrintNightmare’ Vulnerability: Print Spooler Solutions Security | Vulnerability Scans and Assessment
  • Norton RDP
    Can’t connect via RDP upon installing Norton 360 Anti-Virus Solution
  • Delete VM and Storage in Proxmox
    How to delete a VM and Storage in Proxmox Virtualization
  • screenshot 2020 02 08 at 15.53.31
    Enable Automatic Logon on Windows 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,832 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

AWS Azure Bitlocker Microsoft Windows PowerShell WDS Windows 10 Windows 11 Windows Deployment Services Windows Server 2016

Copyright © 2025 TechDirectArchive

 

Loading Comments...
 

You must be logged in to post a comment.