lando / mariadb

The Official MariaDB Lando Plugin
https://docs.lando.dev/mariadb
GNU General Public License v3.0
0 stars 7 forks source link

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

Closed kaszarobert closed 5 months ago

kaszarobert commented 6 months ago

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+.

reynoldsalec commented 6 months ago

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).