• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How Do I Remove Users From MySQL Database?

 
JiaPei Jen
Ranch Hand
Posts: 1309
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am new to the MySQL. I created a test user:
C:\>mysql> GRANT ALL PRIVILEGES ON *.* TO javauser@localhost IDENTIFIED BY 'javadude' WITH GRANT OPTION;
How do I remove this user?
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. Use the REVOKE command as detailed in the mysql docs http://www.mysql.com/doc/en/GRANT.html An advantage of this is that the changes are noticed immediately, however the user is still in the table (but if you 'REVOKE ALL PRIVILEGES', then they have no rights).

2. Go to the tables (and if you've granted btoh global and database privileges, there will be more than one table to look at) directly and execute DELETE statements to completely remove the user. You'll need to FLUSH PRIVILEGES when you are done with this method, but on the other hand, ALL traces of the user are removed.

I've never actually done this. Would there be any repercussions for rollbacks/recovery (ie: if a user did something and you then removed him completely, could you rollback/recover something he did?)
 
Philip Shanks
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are new to MySQL, then probably the easiest way to manage database access privleges is through the mycc interface (MySQL Control Center). This is a multi-platform application that is available here .
I have been using this app for a while now, and although earlier versions suffered from stability problems, it is much improved now.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic