+ Reply to Thread
Results 1 to 4 of 4

Thread: MySQL - What Tables of Modified For New Users?

  1. #1
    CarlosinFL is offline Registered User
    Join Date
    May 2009
    Location
    Orlando, FL
    Posts
    77
    Downloads
    0
    Uploads
    0

    Question MySQL - What Tables Are Modified For New Users?

    I am running MySQL 5 and Roundcube and would like to know when a user logs into Roundcube for the 1st time, what table entries are modified / touched / created in the database?

    I have Roundcube configured to create the user data in the database when you login for the 1st time however I don't know what is created for a new user. This helps me know what needs to be deleted when that user is gone. If I delete that user from my Linux system, I don't want their Roundcube MySQL database data to clutter up after they're deleted from the system.

    Can someone please help me?
    Last edited by CarlosinFL; 07-07-2009 at 04:12 AM.

  2. #2
    JohnDoh is offline Super Moderator
    Join Date
    May 2007
    Posts
    1,206
    Downloads
    6
    Uploads
    0

    Default

    There will be an entry in the Users table and the Identities table, then once they start using the system they could have multiple entries in the Identities table, the Contacts table and if you have caching enabled then in the cache and messages tables too.
    Roundcube Patches: Sieverules, SpamAssassin Prefs, and more…

  3. #3
    CarlosinFL is offline Registered User
    Join Date
    May 2009
    Location
    Orlando, FL
    Posts
    77
    Downloads
    0
    Uploads
    0

    Default

    Thanks. Is there an simple solution I can use or how do other RC admins manage when someone leaves and their Linux shell account is removed. I don't want their accounts to linger with useless data in MySQL. Is there a simple solution to cleaning up MySQL once I remove a user from my mail server?

  4. #4
    maka is offline Registered User
    Join Date
    Apr 2009
    Posts
    1
    Downloads
    0
    Uploads
    0

    Default

    Hi there!

    I have made a couple of bash-scripts to solve this nicely on my domain. Note that you need to know the RC user id of the user you need to remove (I usually map the RC user id to the linux uid when I create a RC user for convenience).

    Run the following 5 SQL commands on your RC DB to remove a user:
    DELETE FROM messages WHERE messages.user_id = <USERID>;
    DELETE FROM cache WHERE cache.user_id = <USERID>;
    DELETE FROM contacts WHERE contacts.user_id = <USERID>;
    DELETE FROM identities WHERE identities.user_id = <USERID>;
    DELETE FROM users WHERE users.user_id = <USERID> LIMIT 1;

    If the RC user id of your user is 6 then replace <USERID> above with 6.

    Please also note that users table must be the last one where you remove the user.

    Hope this helps a bit.

    ~# Magnus
    Last edited by maka; 07-07-2009 at 09:28 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts