Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Results 1 to 8 of 8
  1. #1
    cPanel Partner NOC cPanel Partner NOC Badge DWHS.net's Avatar
    Join Date
    Jul 2002
    Location
    LA, Costa RIca
    Posts
    1,342

    Default Deleting a acount in cpanel does not delete the remote DB

    When I delete the account in cpanel it will not delete the remote database on the remote database server.

    I have to go in and manually remove each one which is very tricky since you don't always know for sure if the database is for a full account or a add-on.

    Any thoughts on how to streamline this?

    maybe a script to see what when the db was last accessed and remove it if it's a year old for example.

  2. #2
    cPanel Partner NOC cPanel Partner NOC Badge DWHS.net's Avatar
    Join Date
    Jul 2002
    Location
    LA, Costa RIca
    Posts
    1,342

    Default

    Anyone come up with a way to know which mysql accounts to delete on the remote mysql server?

    cpanel leaves all mysql DB on the remote server after the the account is deleted in cpanel.

  3. #3
    Member nilesh_kolte's Avatar
    Join Date
    Apr 2006
    Posts
    66

    Default

    Hello,

    Please check the Database clustering for the servers. There seems to be a misconfiguration for remote database setup.
    ~~~ Cool Buddy ~~~

  4. #4
    cPanel Development cpanelkenneth's Avatar
    Join Date
    Apr 2006
    Posts
    3,768
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by DWHS.net View Post
    Anyone come up with a way to know which mysql accounts to delete on the remote mysql server?

    cpanel leaves all mysql DB on the remote server after the the account is deleted in cpanel.
    What do you mean by "you don't always know for sure if the database is for a full account or a add-on" - I'm not understanding the 'add-on' part.

    AS for a work around to this, normal account termination will call /scripts/legacypostkillacct and /scripts/postkillacct /scripts/legacypostkillacct might be the easiest to use since the first argument passed to it is the name of the user account to terminate. Some quick, untested code that illustrates this:

    Code:
    #!/bin/bash
    
    set USER=$ARGV[0]
    
    mysql -h 192.168.0.1 -u root < "DROP DATABASE $USER"
    Granted, that's only going to delete the primary database of the user, not databases in the format user_dbname. Nor does it revoke privileges.

  5. #5
    cPanel Partner NOC cPanel Partner NOC Badge DWHS.net's Avatar
    Join Date
    Jul 2002
    Location
    LA, Costa RIca
    Posts
    1,342

    Default

    I can delete the databases fine manually, I just don't know if the account is still live without going to the main server and searching for the user name.

    There is a tool that checks the user names for cpanel on a server and removes backups for any accounts backup that does have a live username.

    I was hoping to find a way to tell on the remote mysql server if the database is for a live cpanel account or one that is removed.

    Otherwise to clean up the mysql server I have to check the database username and see if that username is live on the main server. This isn't bad other then their being about 5k databases on the server.

  6. #6
    cPanel Partner NOC cPanel Partner NOC Badge DWHS.net's Avatar
    Join Date
    Jul 2002
    Location
    LA, Costa RIca
    Posts
    1,342

    Default

    Maybe there is way to check when the databases was last accessed? Someway in a bulk method on the mysql server.

  7. #7
    cPanel Partner NOC cPanel Partner NOC Badge DWHS.net's Avatar
    Join Date
    Jul 2002
    Location
    LA, Costa RIca
    Posts
    1,342

    Default

    I really wish cpanel would fix this or find a way to list the databases not being used anymore on remote mysql servers.

  8. #8
    Member
    Join Date
    Mar 2004
    Posts
    53

    Default

    I'm also having the same problem, a solution would be nice

Similar Threads & Tags
Similar threads

  1. Remaining files after deleting an account, may I manually delete them?
    By Kent Brockman in forum cPanel and WHM Discussions
    Replies: 10
    Last Post: 06-01-2009, 11:33 AM
  2. Delete MySQL Remote Access Host
    By wswd in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 11-19-2008, 03:35 AM
  3. Deleting Subdomain does not actually delete it
    By jeremy@dailydna in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 08-07-2008, 09:32 AM
  4. Deleting a domain doesn't fully delete it?
    By ramirez in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 04-29-2008, 12:07 AM
  5. How to stop deleting "Delete Mail Queue"
    By rip_curl in forum cPanel and WHM Discussions
    Replies: 9
    Last Post: 02-10-2006, 04:15 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube