ucan-lab / docker-laravel

🐳 Build a simple laravel development environment with Docker Compose.
https://dev.to/ucan_lab/how-to-install-and-set-up-laravel-s-local-development-environment-with-docker-compose-5bcf
MIT License
1.17k stars 380 forks source link

schema:dump, mysqldump: unknown variable 'column-statistics=0' and 'set-gtid-purged=OFF' #239

Closed ucan-lab closed 4 months ago

ucan-lab commented 9 months ago
$ php artisan schema:dump
mysqldump: unknown variable 'column-statistics=0'
mysqldump: unknown variable 'set-gtid-purged=OFF'

   INFO  Database schema dumped successfully.

Is there a way to remove the unknown variable message?

https://github.com/ucan-lab/docker-laravel/blob/v2.4.2/infra/docker/mysql/my.cnf

There is nothing written in the mysqldump section.

ucan-lab commented 9 months ago
$ mysqldump -V
mysqldump  Ver 10.19 Distrib 10.5.21-MariaDB, for debian-linux-gnu (x86_64)

https://github.com/ucan-lab/docker-laravel/blob/v2.4.2/infra/docker/php/Dockerfile#L38

Since default-mysql-client installs MariaDB instead of MySQL, are the variable incompatible?

ucan-lab commented 4 months ago

Here, the framework side specified an option...

https://github.com/laravel/framework/blob/11.x/src/Illuminate/Database/Schema/MySqlSchemaState.php#L153

https://github.com/laravel/framework/blob/11.x/src/Illuminate/Database/Schema/MySqlSchemaState.php#L161