Basics of Tuning and Tuning Costs in Oracle 12c
Combine Information from Multiple MySQL Tables with UNION
How to Retrieve Data from Specific Rows in MySQL Databases

How to Remove MySQL Accounts

You might want to remove an account from a MySQL database. In most cases, having an account that no one uses doesn’t have any negative effects. However, if you think an account has been compromised, you might want to remove it for security reasons.

To remove an account, you can use the DROP USER statement (which was added in MySQL 4.1.1), as follows:

DROP USER accountname@hostname, accountname@hostname, ...

You must use an account that has DELETE privileges on the mysql database to execute the DROP USER statement.

The behavior of DROP USER has changed through MySQL versions. As of MySQL 5.0.2, it removes the account and all records related to the account, including records that give the account privileges on specific databases or tables. However, in versions before MySQL 5.0.2, DROP USER drops only accounts that have no privileges.

Therefore, in older versions, you must remove all the privileges from an account, including database or table privileges, before you can drop that account.

  • Add a Comment
  • Print
  • Share
blog comments powered by Disqus
How to Use Oracle 12c’s Data Dictionary
Creating a New User in Oracle9i
Basics of Data and Control Files in Oracle 12c
How to Create Roles in Oracle 12c
How to Check Users and Database Usage in Oracle 12c