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

MariaDB 11 deprecates mysqldump, need an option to use else in lando db-export and lando db-import scripts #47

Closed
kaszarobert opened this issue Mar 19, 2024 · 1 comment · Fixed by lando/core#148
Assignees

Comments

@kaszarobert
Copy link
Contributor

If you force Lando to use image bitnami/mariadb:11.0.5-debian-12-r5 for database service, running lando db-export and lando db-import shows this on CLI:

pc@ASUS-PC:~/lando-projects/drupal2.localhost$ lando db-export 1100.sql
Preparing to export /app/1100.sql from database 'drupal2' on service 'database' as user root...
mysqldump: Deprecated program name. It will be removed in a future release, use '/opt/bitnami/mariadb/bin/mariadb-dump' instead
Success /app/1100.sql.gz was created!

pc@ASUS-PC:~/lando-projects/drupal2.localhost$ lando db-import 1100.sql.gz
Preparing to import /app/1100.sql.gz into database 'drupal2' on service 'database' as user root...

Emptying drupal2...
NOTE: See the --no-wipe flag to avoid this step!
mysql: Deprecated program name. It will be removed in a future release, use '/opt/bitnami/mariadb/bin/mariadb' instead
Dropping batch from drupal2 database...
mysql: Deprecated program name. It will be removed in a future release, use '/opt/bitnami/mariadb/bin/mariadb' instead
Dropping block_content from drupal2 database...
...
mysql: Deprecated program name. It will be removed in a future release, use '/opt/bitnami/mariadb/bin/mariadb' instead
Dropping watchdog from drupal2 database...
mysql: Deprecated program name. It will be removed in a future release, use '/opt/bitnami/mariadb/bin/mariadb' instead
Gzipped file detected!
Importing /app/1100.sql.gz...
mysql: Deprecated program name. It will be removed in a future release, use '/opt/bitnami/mariadb/bin/mariadb' instead
Import complete!

It runs fine right now, you just meet with deprecation messages. But in the future it could no longer work for MariaDB, so we need a way to switch to '/opt/bitnami/mariadb/bin/mariadb-dump' instead for MariaDB 11+.

@pirog pirog transferred this issue from lando/core Mar 25, 2024
@reynoldsalec
Copy link
Sponsor Member

Thanks for bringing this up @kaszarobert! This looks like a great contributor issue. Right now the db-export/import commands are managed from scripts in lando/core, ex: https://github.com/lando/core/blob/main/scripts/sql-export.sh

We'd probably just need to add an additional condition for Mariadb (like we do for Postgres). I think this is a problem restricted to Lando v3, but even though the changes will be to lando/core, we'll want to test this out in the examples directory in this project (lando/mariadb).

@reynoldsalec reynoldsalec reopened this Apr 1, 2024
christopher-b added a commit to christopher-b/lando-core that referenced this issue Apr 17, 2024
`mysqldump` is deprecated in current versions of MariaDB, and generates a
deprecation warning. This change allows `db-export` to use `mariadb-dump`
if that command exists and the `MARIADB_DATABASE` env var is set.

Resolves lando/mariadb#47
christopher-b added a commit to christopher-b/lando-mariadb that referenced this issue Apr 17, 2024
This is a test for a proposed change to lando/core, to address
lando#47.
@christopher-b christopher-b self-assigned this Apr 29, 2024
reynoldsalec added a commit to lando/core that referenced this issue May 2, 2024
* Make `lando db-export` use mariadb-dump, if exists

`mysqldump` is deprecated in current versions of MariaDB, and generates a
deprecation warning. This change allows `db-export` to use `mariadb-dump`
if that command exists and the `MARIADB_DATABASE` env var is set.

Resolves lando/mariadb#47

* Fix typo in sql-export.sh comment

* Update CHANGELOG.

---------

Co-authored-by: Alec Reynolds <alec+git@lando.dev>
reynoldsalec added a commit to christopher-b/lando-mariadb that referenced this issue Jun 11, 2024
reynoldsalec added a commit to christopher-b/lando-mariadb that referenced this issue Jun 11, 2024
reynoldsalec added a commit to christopher-b/lando-mariadb that referenced this issue Jun 11, 2024
reynoldsalec added a commit that referenced this issue Jun 11, 2024
* Add test case for mysqldump deprecation

This is a test for a proposed change to lando/core, to address
#47.

* Improve mysqldump deprecation test

Make better use of `grep` in the test, and direct output of dump command
to STDOUT so the test doesn't generate export files.

* #47: Test a db-export type tooling command.

* #47: Make sure we actually add the test.

* #47: Better name for the test.

* Make checklinks happy.

* Make checklinks happy.

---------

Co-authored-by: Alec Reynolds <alec+git@lando.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging a pull request may close this issue.

3 participants