Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go-mysqldump fails to dump MariaDB 11.4 database #940

Open
dveeden opened this issue Nov 8, 2024 · 1 comment
Open

go-mysqldump fails to dump MariaDB 11.4 database #940

dveeden opened this issue Nov 8, 2024 · 1 comment
Assignees
Labels

Comments

@dveeden
Copy link
Collaborator

dveeden commented Nov 8, 2024

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 a mysqldump (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:

  1. Try to use mariadb-dump for mysql.MariaDBFlavor
  2. Add MariaDB and go-mysqldump to CI
  3. Create an option to run go-mysqldump without binlog position (--skip-binlog-pos?) and then call mysqldump without the --source-data option.
  4. Detect if server and mysqldump are incompatible and give a warning/error
@dveeden dveeden added the mariadb label Nov 8, 2024
@dveeden
Copy link
Collaborator Author

dveeden commented Nov 8, 2024

When running in the container via podman exec -it 731c251556d1 /bin/bash (731c251556d1 is the container ID that I got via podman ps):

apt-get update
apt-get install git golang make
git clone https://github.com/go-mysql-org/go-mysql.git
cd go-mysql
make build
root@731c251556d1:/go-mysql# ./bin/go-mysqldump 
Create Dumper error exec: "mysqldump": executable file not found in $PATH
github.com/pingcap/errors.AddStack
	/root/go/pkg/mod/github.com/pingcap/[email protected]/errors.go:174
github.com/pingcap/errors.Trace
	/root/go/pkg/mod/github.com/pingcap/[email protected]/juju_adaptor.go:15
github.com/go-mysql-org/go-mysql/dump.NewDumper
	/go-mysql/dump/dumper.go:60
main.main
	/go-mysql/cmd/go-mysqldump/main.go:30
runtime.main
	/usr/lib/go-1.22/src/runtime/proc.go:271
runtime.goexit
	/usr/lib/go-1.22/src/runtime/asm_amd64.s:1695
root@731c251556d1:/go-mysql# ./bin/go-mysqldump -exec mariadb-dump
[2024/11/08 07:15:53] [info] dumper.go:294 exec mysqldump with [--host=127.0.0.1 --port=3306 --user=root --password=****** --master-data --single-transaction --skip-lock-tables --compact --skip-opt --quick --no-create-info --skip-extended-insert --skip-tz-utc --default-character-set=utf8 --all-databases]
WARNING: option --ssl-verify-server-cert is disabled, because of an insecure passwordless login.
/*!999999\- enable the sandbox mode */ 
mariadb-dump: Couldn't execute 'SELECT BINLOG_GTID_POS('', '0')': You are not using binary logging (1381)
Dump MySQL error exit status 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant