Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This issue is against HEAD.
When using an external database server the site db and mysql user are not being deleted when you delete a site.
I can't confirm if this is an issue with a local db server so if someone else can check that it would be great.
Comment | File | Size | Author |
---|---|---|---|
#6 | aegir_455954_dbclient_refactor.patch | 8.51 KB | anarcat |
Comments
Comment #1
acAlso seems /sites/site.example.com is not being removed.
Comment #2
anarcat CreditAttribution: anarcat commentedI confirm the issue with local DBs too. Take a look at this task log:
It just does the backup, but no delete.
Comment #3
anarcat CreditAttribution: anarcat commentedSo I think I fixed this in the latest HEAD. I tested only with localhost this time, please test again with a remote SQL server.
Comment #4
acDatabase is deleted but user is not when using an external db server.
Comment #5
anarcat CreditAttribution: anarcat commentedI confirm that issue on localhost installs.
Comment #6
anarcat CreditAttribution: anarcat commentedSo I have made a patch with basically finished off the patch #337485: allow configuration of the 'host' part of the created mysql users. It seems I forgot quite a few places that were using the host part of the URL.
So I have refactored the "dbclient" guessing in a function and used it everywhere relevant.
I would appreciate if this could be tested before it hits the tree as it is quite invasive.
Comment #7
anarcat CreditAttribution: anarcat commentedTo clarify, the patch takes care of fixing all the incorrect usages of
$db_host
in the code.$db_host
is the name of the SQL server and it should never be confused with what we now call the$db_client
, which is the host the server will appear to connect from.$db_client
is usuallyweb_ip
orweb_host
Maybe that should be part of
provision_drush_init()
instead of being duplicated in two functions, but I stick to the agile principle of not refactoring too much, especially since an eventual$db_client
option would be a duplicate of theweb_ip
/web_host
combo.Comment #8
anarcat CreditAttribution: anarcat commentedActually, even with the patch, the user is not deleted. I must have missed something.
Comment #9
anarcat CreditAttribution: anarcat commentedOh my god. MySQL is so awful. Believe it or not, revoking the GRANT is not enough. You also need to DROP USER:
http://dev.mysql.com/doc/refman/5.0/en/drop-user.html
So I have to add this complicated piece of code to see if the user has a GRANT or not.
I'm going to commit this. It is necessary for the users to be removed properly, regardless of #337485: allow configuration of the 'host' part of the created mysql users. I would like testing, but I'm confident this is solid now.
Comment #10
acConfirmed working on external DB