Open
Description
MariaDB instance (11.4.2-MariaDB-ubu2404) as container:
podman run -p 3307:3306 -e MARIADB_ALLOW_EMPTY_ROOT_PASSWORD=1 -it mariadb:latest
Running go-mysqldump
like this:
$ ./bin/go-mysqldump -addr 127.0.0.1:3307
[2024/11/08 07:51:20] [info] dumper.go:294 exec mysqldump with [--host=127.0.0.1 --port=3307 --user=root --password=****** --source-data --single-transaction --skip-lock-tables --compact --skip-opt --quick --no-create-info --skip-extended-insert --skip-tz-utc --default-character-set=utf8 --column-statistics=0 --all-databases]
mysqldump: [Warning] Using a password on the command line interface can be insecure.
mysqldump: Couldn't execute 'SHOW BINARY LOG STATUS': You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'LOG STATUS' at line 1 (1064)
Dump MySQL error exit status 2
The problem here is not in go-mysql directly, but with mysqldump
$ mysqldump --host=127.0.0.1 --port=3307 --user=root --source-data --single-transaction --skip-lock-tables --compact --skip-opt --quick --no-create-info --skip-extended-insert --skip-tz-utc --default-character-set=utf8 --column-statistics=0 --all-databases
mysqldump: Couldn't execute 'SHOW BINARY LOG STATUS': You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'LOG STATUS' at line 1 (1064)
$ mysqldump -V
mysqldump Ver 9.1.0 for Linux on x86_64 (MySQL Community Server - GPL)
- Running
mysqldump
without--source-data
option works, but this would result in a dump without binlog position. - The container has
mariadb-dump
, but not amysqldump
(see also https://mariadb.com/kb/en/mysqldump/ ) - Unfortunately MariaDB (
mariadb-dump
) and MySQL (mysqldump
) can't be installed on the same system due to packages are set to conflict with each other, at least on Fedora 41.
Possible actions:
- Try to use
mariadb-dump
formysql.MariaDBFlavor
- Add MariaDB and
go-mysqldump
to CI - Create an option to run
go-mysqldump
without binlog position (--skip-binlog-pos
?) and then callmysqldump
without the--source-data
option. - Detect if server and
mysqldump
are incompatible and give a warning/error