# Schedule backup database remote mysql error

**URL:** <https://forum.virtualmin.com/t/schedule-backup-database-remote-mysql-error/132874>\
**Category:** Webmin\
**Created:** [April 2, 2025, 9:58am UTC](https://forum.virtualmin.com/t/schedule-backup-database-remote-mysql-error/132874 "2025-04-02T09:58:35Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![oMikR0n](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/omikr0n/32/1519_2.png) [@oMikR0n](https://forum.virtualmin.com/u/oMikR0n)\
**Post date:** [April 2, 2025, 9:58am UTC](https://forum.virtualmin.com/t/schedule-backup-database-remote-mysql-error/132874/1 "2025-04-02T09:58:35Z")

</div>

| SYSTEM INFORMATION | |
| --- | --- |
| Operating system: Ubuntu Linux 24.04.2 | |
| Webmin version: 2.303 | |
| Virtualmin version: 7.30.8 | |

I connected a remote (Digital Ocean Managed Database) which is MySQL 8 and my Ubuntu virtualmin box has Mariadb and when i am trying to dump I get:

```auto
Creating backup for virtual server example.com ..
    Dumping MariaDB database example..
    .. dump failed!
    /usr/bin/mysqldump: unknown variable 'set-gtid-purged=OFF'
    Backup failed! See the progress output above for the reason why.

```

I found [this](https://github.com/webmin/webmin/blob/e5beb7f02204f8ff5b19c8c7d24e3edc1649e76c/mysql/mysql-lib.pl#L1692C4-L1692C11) line that may cause the error and already tried to add in mariadb module configuration and in mysqldump command the `--set-gtid-purged=AUTO` but dont seem to work.  
Any idea?

---

<div class="post-metadata">

**Author:** ![dimitrist](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/dimitrist/32/21546_2.png) [@dimitrist](https://forum.virtualmin.com/u/dimitrist)\
**Post date:** [April 2, 2025, 10:36am UTC](https://forum.virtualmin.com/t/schedule-backup-database-remote-mysql-error/132874/2 "2025-04-02T10:36:47Z")

</div>

not so sure, but i think mariabd (client) doesn’t support this option `set-gtid-purged`  
if you can’t remove this option, maybe try to install mysql-client ?  
not sure if this would also be compatible with local mariadb databases. (if any).

2c.

---

<div class="post-metadata">

**Author:** ![oMikR0n](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/omikr0n/32/1519_2.png) [@oMikR0n](https://forum.virtualmin.com/u/oMikR0n)\
**Post date:** [April 2, 2025, 11:00am UTC](https://forum.virtualmin.com/t/schedule-backup-database-remote-mysql-error/132874/3 "2025-04-02T11:00:18Z")

</div>

Thanks for the suggestion but it wants to remove everything related and I am afraid that break the system

 ![image](https://cdn.forum.virtualmin.com/uploads/default/original/3X/6/6/66d1094dae4b9bf3526e6504367c8d71b2da13eb.png)

---

<div class="post-metadata">

**Author:** ![Stegan](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/stegan/32/6860_2.png) [@Stegan](https://forum.virtualmin.com/u/Stegan)\
**Post date:** [April 2, 2025, 2:17pm UTC](https://forum.virtualmin.com/t/schedule-backup-database-remote-mysql-error/132874/4 "2025-04-02T14:17:34Z")

</div>

> [@oMikR0n](#):
>
> I connected a remote (Digital Ocean Managed Database) which is MySQL 8

As DO are the cause of the problem why not ask them  
(other providers do not force mysql)

---

<div class="post-metadata">

**Author:** ![oMikR0n](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/omikr0n/32/1519_2.png) [@oMikR0n](https://forum.virtualmin.com/u/oMikR0n)\
**Post date:** [April 2, 2025, 2:33pm UTC](https://forum.virtualmin.com/t/schedule-backup-database-remote-mysql-error/132874/5 "2025-04-02T14:33:18Z")

</div>

I don’t think that is digital ocean the problem. I think that its just virtualmin doesn’t care if i dumping local databases (which in my setup is MariaDB) and not a remote one which it can be mysql that its just adds the flag…

Update: Commenting out this line btw works ok

---

<div class="post-metadata">

**Author:** ![Stegan](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/stegan/32/6860_2.png) [@Stegan](https://forum.virtualmin.com/u/Stegan)\
**Post date:** [April 2, 2025, 3:23pm UTC](https://forum.virtualmin.com/t/schedule-backup-database-remote-mysql-error/132874/6 "2025-04-02T15:23:19Z")

</div>

> [@oMikR0n](#):
>
> I think that its just virtualmin doesn’t care if i dumping local databases (which in my setup is MariaDB) and not a remote one

seems strange that you are saying it is Virtualmin.

i would have expected more complaints on this if it were (i.e. from other users that have remote db)

---

<div class="post-metadata">

**Author:** ![dimitrist](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/dimitrist/32/21546_2.png) [@dimitrist](https://forum.virtualmin.com/u/dimitrist)\
**Post date:** [April 3, 2025, 8:52am UTC](https://forum.virtualmin.com/t/schedule-backup-database-remote-mysql-error/132874/7 "2025-04-03T08:52:25Z")

</div>

virtualmin uses whatever db client is installed. your package manager (OS) doesn’t allow both mysql-client and mariadb-client (for good reasons imho), so problem is there. not virtualmin.

anyway, if removing that incompatible line, makes backup work, no need to dig any further.  
if it didn’t work that way, i’d probably exclude this db from local virtualmin backup and use some other way (perhaps in DO if there’s such an option…)

---

<div class="post-metadata">

**Author:** ![oMikR0n](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/omikr0n/32/1519_2.png) [@oMikR0n](https://forum.virtualmin.com/u/oMikR0n)\
**Post date:** [April 3, 2025, 11:40am UTC](https://forum.virtualmin.com/t/schedule-backup-database-remote-mysql-error/132874/8 "2025-04-03T11:40:02Z")

</div>

Yes of course but it will break again when webmin gets updated

---

<div class="post-metadata">

**Author:** ![soraver](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/soraver/32/4955_2.png) [@soraver](https://forum.virtualmin.com/u/soraver)\
**Post date:** [April 3, 2025, 11:51am UTC](https://forum.virtualmin.com/t/schedule-backup-database-remote-mysql-error/132874/9 "2025-04-03T11:51:47Z")

</div>

As I understand it, this is not an attack against Virtualmin.  
It is a bug report, from someone who likes it and uses it for more things than it is usually used.

For sure it not a DO issue. It is irrelevant whether the user or the distro did the decision of the mysql type and version. If Virtualmin is not compatible with mariadb it should be stated in dependencies.

To the bug report now:  
Virtualmin for some reason doesn’t understand that the remote database is not compatible with the given setting. This is the issue. It would be nice to git it fixed, so the users don’t have issues in the future.

---

<div class="post-metadata">

**Author:** ![Ilia](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/ilia/32/10185_2.png) [@Ilia](https://forum.virtualmin.com/u/Ilia)\
**Post date:** [April 3, 2025, 12:34pm UTC](https://forum.virtualmin.com/t/schedule-backup-database-remote-mysql-error/132874/10 "2025-04-03T12:34:18Z")

</div>

> [@oMikR0n](#):
>
> Yes of course but it will break again when webmin gets updated

It does seem to be a bug! Temporarily, you can manually edit the mentioned `mysql-lib.pl` file and comment out the line `$gtidsql = "--set-gtid-purged=OFF";`.

> [@oMikR0n](#):
>
> I don’t think that is digital ocean the problem. I think that its just virtualmin doesn’t care if i dumping local databases (which in my setup is MariaDB) and not a remote one which it can be mysql that its just adds the flag…

@Jamie, could you take a look?

---

<div class="post-metadata">

**Author:** ![Jamie](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/jamie/32/8589_2.png) [@Jamie](https://forum.virtualmin.com/u/Jamie)\
**Post date:** [April 4, 2025, 4:52am UTC](https://forum.virtualmin.com/t/schedule-backup-database-remote-mysql-error/132874/11 "2025-04-04T04:52:49Z")

</div>

> [@Ilia](#):
>
> @Jamie, could you take a look?

So we should already handle this for remote databases by running the SQL `show variables like 'gtid_mode'` on the remote server to check if that option exists before setting the `--set-gtid-purged=OFF` flag.

That said, if the `mysqldump` command set in the module config already has `--set-gtid-purged=AUTO` we shouldn’t re-set the flag again! I’ll fix that …

---

<div class="post-metadata">

**Author:** ![Ilia](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/ilia/32/10185_2.png) [@Ilia](https://forum.virtualmin.com/u/Ilia)\
**Post date:** [April 4, 2025, 9:21am UTC](https://forum.virtualmin.com/t/schedule-backup-database-remote-mysql-error/132874/12 "2025-04-04T09:21:37Z")

</div>

> [@oMikR0n](#):
>
> I found [this](https://github.com/webmin/webmin/blob/e5beb7f02204f8ff5b19c8c7d24e3edc1649e76c/mysql/mysql-lib.pl#L1692C4-L1692C11) line that may cause the error and already tried to add in mariadb module configuration and in mysqldump command the `--set-gtid-purged=AUTO` but dont seem to work.  
> Any idea?

@oMikR0n, try applying Jamie’s patch to see if it works for your case as expected:

```auto
webmin patch https://github.com/webmin/webmin/commit/b1fdf42

```

---

<div class="post-metadata">

**Author:** ![oMikR0n](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/omikr0n/32/1519_2.png) [@oMikR0n](https://forum.virtualmin.com/u/oMikR0n)\
**Post date:** [April 5, 2025, 12:45pm UTC](https://forum.virtualmin.com/t/schedule-backup-database-remote-mysql-error/132874/13 "2025-04-05T12:45:29Z")

</div>

How I can force patch it?  
I tried to uncomment the line i tried before but hash look different and aborts it

 ![image](https://cdn.forum.virtualmin.com/uploads/default/original/3X/5/a/5af403cd3d3a7f30ecf632c771e2674ab7ceb410.png)

---

<div class="post-metadata">

**Author:** ![oMikR0n](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/omikr0n/32/1519_2.png) [@oMikR0n](https://forum.virtualmin.com/u/oMikR0n)\
**Post date:** [April 5, 2025, 12:58pm UTC](https://forum.virtualmin.com/t/schedule-backup-database-remote-mysql-error/132874/14 "2025-04-05T12:58:06Z")

</div>

Ok I reverted the file back to github one from [here](https://raw.githubusercontent.com/webmin/webmin/refs/tags/2.303/mysql/mysql-lib.pl) and patched successfully after that:  
 ![image](https://cdn.forum.virtualmin.com/uploads/default/original/3X/1/f/1f9c4729f9ca813dfd1be911cd13a98e7f5a4103.png)  
But I again getting the same error. Do I need to --set-gtid-purged to AUTO in mysqldump command?

---

<div class="post-metadata">

**Author:** ![oMikR0n](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/omikr0n/32/1519_2.png) [@oMikR0n](https://forum.virtualmin.com/u/oMikR0n)\
**Post date:** [April 5, 2025, 1:01pm UTC](https://forum.virtualmin.com/t/schedule-backup-database-remote-mysql-error/132874/15 "2025-04-05T13:01:45Z")

</div>

Nope the same with setting it to AUTO

 ![image](https://cdn.forum.virtualmin.com/uploads/default/original/3X/4/2/42bf53a831d994499315e45c5847ba2ba333f339.png)

---

<div class="post-metadata">

**Author:** ![oMikR0n](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/omikr0n/32/1519_2.png) [@oMikR0n](https://forum.virtualmin.com/u/oMikR0n)\
**Post date:** [April 5, 2025, 1:04pm UTC](https://forum.virtualmin.com/t/schedule-backup-database-remote-mysql-error/132874/16 "2025-04-05T13:04:11Z")

</div>

And I also have to mention that it takes over a minute to list databases in Webmin → Servers → Mariadb Database Server but at least it list them successfully…

---

<div class="post-metadata">

**Author:** ![Ilia](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/ilia/32/10185_2.png) [@Ilia](https://forum.virtualmin.com/u/Ilia)\
**Post date:** [April 5, 2025, 1:36pm UTC](https://forum.virtualmin.com/t/schedule-backup-database-remote-mysql-error/132874/17 "2025-04-05T13:36:15Z")

</div>

> [@oMikR0n](#):
>
> And I also have to mention that it takes over a minute to list databases in Webmin → Servers → Mariadb Database Server but at least it list them successfully…

Something is going seriously wrong with your MariaDB server.

---

<div class="post-metadata">

**Author:** ![oMikR0n](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/omikr0n/32/1519_2.png) [@oMikR0n](https://forum.virtualmin.com/u/oMikR0n)\
**Post date:** [April 5, 2025, 10:18pm UTC](https://forum.virtualmin.com/t/schedule-backup-database-remote-mysql-error/132874/18 "2025-04-05T22:18:16Z")

</div>

@Ilia as I mentioned before, MariaDB is installed in my Ubuntu box, but I don’t use it. I connected to virtualmin a remote Digital Ocean MySQL 8 managed database.

---

<div class="post-metadata">

**Author:** ![Joe](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/joe/32/9_2.png) [@Joe](https://forum.virtualmin.com/u/Joe)\
**Post date:** [April 6, 2025, 1:41am UTC](https://forum.virtualmin.com/t/schedule-backup-database-remote-mysql-error/132874/19 "2025-04-06T01:41:25Z")

</div>

> [@oMikR0n](#):
>
> How I can force patch it?

I know you sorted it out, but you should never force a patch to apply. It’s not applying because the file being patched doesn’t match what the patch was derived from, and forcing it would be destructive and do nothing good.

---

<div class="post-metadata">

**Author:** ![oMikR0n](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/omikr0n/32/1519_2.png) [@oMikR0n](https://forum.virtualmin.com/u/oMikR0n)\
**Post date:** [April 6, 2025, 5:42pm UTC](https://forum.virtualmin.com/t/schedule-backup-database-remote-mysql-error/132874/20 "2025-04-06T17:42:26Z")

</div>

I understand this but I know that my edit which I commented the line before, altered its hash. Anyway after the revert to the original content and patch successfully gave the same error again. I want to thank you all again for your time and the patch but looks like doesn’t help for some reason. I am more than happy to test and share any more info if that helps you

[Next page](https://forum.virtualmin.com/t/schedule-backup-database-remote-mysql-error/132874.md?page=2)
