nystudio107 / craft-scripts

Shell scripts to manage database backups, asset backups, file permissions, asset syncing, cache clearing, and database syncing between Craft CMS environments

Home Page:https://nystudio107.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unsupported mysqldump args cause scripts to fail with MariaDB

michaelroper opened this issue · comments

Apparently MariaDB does not recognise the --set-gtid-purged=OFF arg that was added in the last update, so pull_db.sh may fail if the DB in use is MariaDB.

$ ./scripts/pull_db.sh
mysqldump: unknown variable 'set-gtid-purged=OFF'
mysqldump: unknown variable 'set-gtid-purged=OFF'
site-db-dump-20210206.sql.gz       100%   58     0.9KB/s   00:00    
mysqldump: unknown variable 'set-gtid-purged=OFF'

Found a similar issue on the Laravel repo which probably describes it better.

If I comment out that line, it seems to work fine for me again, though my remote is a MariaDB instance on Amazon RDS. Not sure if there's a way around it that also works for those permissions issues you were trying to solve?

hmmm. Probably the way to solve it would be to move an additional params to the .env.sh file or such.

We are running into this issue with MariaDB on our production servers as well. Realized that DB backups were just empty files. Going to the previous commit d8ccc74 fixes the problem.