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

artisan schema:dump error #34592

Closed
pendolf opened this issue Sep 30, 2020 · 5 comments · Fixed by #36698
Closed

artisan schema:dump error #34592

pendolf opened this issue Sep 30, 2020 · 5 comments · Fixed by #36698

Comments

@pendolf
Copy link

pendolf commented Sep 30, 2020

  • Laravel Version: 8.6.0
  • PHP Version: 7.3.22
  • Database Driver & Version:
    mysqldump Ver 10.16 Distrib 10.1.45-MariaDB, for debian-linux-gnu (x86_64)
    mysql 8.0.20

Description:

When i run php artisan schema:dump it returns followed error:

mysqldump: unknown variable 'set-gtid-purged=OFF'
[2020-09-30 05:29:36] local.ERROR: The command "mysqldump --set-gtid-purged=OFF --skip-add-drop-table --skip-add-locks --skip-comments --skip-set-charset --tz-utc --host="${:LARAVEL_LOAD_HOST}" --port="${:LARAVEL_LOAD_PORT}" --user="${:LARAVEL_LOAD_USER}" --password="${:LARAVEL_LOAD_PASSWORD}" "${:LARAVEL_LOAD_DATABASE}" --routines --result-file="${:LARAVEL_LOAD_PATH}" --no-data" failed.

Steps To Reproduce:

I am using php:7.3-apache-stretch docker image and install default mysql-client with apt.

@yarbala
Copy link

yarbala commented Sep 30, 2020

I have the same error, in Alpine linux. It comes from mariadb client, because it is default on alpine.

mysqldump Ver 10.17 Distrib 10.4.13-MariaDB, for Linux (x86_64)

In my opinion it is no problem to remove this option. In documentation of original mysqlclient it is:

If OFF is used, this option does nothing.

@GrahamCampbell
Copy link
Member

I think this might have been fixed in the very latest release. Can you upgrade?

@taylorotwell
Copy link
Member

taylorotwell commented Sep 30, 2020

If you have a fix please submit a PR. I do not plan to spend anymore personal time on various mysql client issues with schema:dump.

@yarbala
Copy link

yarbala commented Oct 1, 2020

It is not laravel bug. In my case - client is maria db, but DB is MySQL. When you install mysql client on Alpine linux, it uses mariadb client instead. So code:

\Illuminate\Database\Schema\MySqlSchemaState::baseDumpCommand
$gtidPurged = $this->connection->isMaria() ? '' : '--set-gtid-purged=OFF';

not works

@pendolf
Copy link
Author

pendolf commented Oct 1, 2020

@yarbala Yea, I understand it. And I don't say what is a bug. But the given command don't give me a choice to choose any options. Moreover the GTID option is for servers that use GTID-based replication, it's not enabled by default in mysql 5.6, 5.7, 8.0, so I don't understand why this --set-gtid-purged=OFF should be included in mysqldump command.

taylorotwell added a commit that referenced this issue Mar 22, 2021
* It mysqldump errors because "set-gtid-purged" isn't a valid option retry without it.

* Update MySqlSchemaState.php

Co-authored-by: Matt Davis <Hamroll3>
Co-authored-by: Taylor Otwell <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants