• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

How Do I Remove Users From MySQL Database?

 
Ranch Hand
Posts: 1309
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?)
 
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
He was giving me directions and I was powerless to resist. I cannot resist this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic