aspose file tools
The moose likes JDBC and the fly likes How Do I Remove Users From MySQL Database? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "How Do I Remove Users From MySQL Database?" Watch "How Do I Remove Users From MySQL Database?" New topic
Author

How Do I Remove Users From MySQL Database?

JiaPei Jen
Ranch Hand

Joined: Nov 19, 2000
Posts: 1309
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

Joined: Feb 20, 2001
Posts: 3695

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

Joined: Oct 15, 2002
Posts: 189
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.


Philip Shanks, SCJP - Castro Valley, CA
My boss never outsources or has lay-offs, and He's always hiring. I work for Jesus! Prepare your resume!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How Do I Remove Users From MySQL Database?
 
Similar Threads
MySQL : Access denied for mysqldump
headache! jboss+mysql problem
Configure Tomcat & Mysql
MySQL user and password errors
Mysql administration