-
Notifications
You must be signed in to change notification settings - Fork 11.4k
[12.x] Update schema dump to use new MySQL SSL disable flag #55758
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
Conversation
Thanks for submitting a PR! Note that draft PR's are not reviewed. If you would like a review, please mark your pull request as ready for review in the GitHub user interface. Pull requests that are abandoned in draft may be closed due to inactivity. |
@ziadoz I think it is a little more complicated than that. The availability of this option differs from the MySQL server and client. I'm using the latest MySQL docker image and running Laravel on a php:8.4-fpm-alpine image (with mysql-client installed) and it works fine with Server
Client
|
@andersonls That's interesting, thanks for the input. Any thoughts on a better solution? I did wonder if some kind of |
@ziadoz I did some more digging and testing, and actually it was my mistake. The I don't know about the |
I think most Linux distros are shipping the MariaDB client/server instead of the MySQL one now, even if they're so far diverged at this point they're separate things, so I expect this will be an issue for anyone using Docker, because the client will be MariaDB and the server will be MySQL. |
@andersonls I pushed a commit here which checks if the |
Yes it does work. But I'm wondering if it shouldn't fallback to the
|
@andersonls I assume the deprecation depends on the Linux distro being used (I'm guessing that's Alpine?). But Would falling back to the |
That's a good point, and yes, I'm using Alpine at the moment.
dumping/loading a MySQL database via the MariaDB client is exactly what's happening in my case. I would prefer to fallback to the MariaDB class than adding checks to see which client is installed, but maybe the best approach is to leave it to the user to install the mysql client manually if needed? |
@andersonls The solution I've come up with to resolve this in Docker is to configure the MariaDB client directly in
I do think it would be nice if we were able to add additional options/flags onto these schema dumping/loading classes, but one for another day perhaps. |
@taylorotwell what's your thought on this? Should I create a new PR to change the option to |
#55683 allowed SSL to be disabled when Laravel imports schema SQL. However, the
--ssl=off
flag was deprecated in 8.0.26 and removed in MySQL 8.0.40:Error: [ERROR] unknown variable 'ssl=off'.
This PR checks the MySQL version and uses the newer
--ssl-mode=DISABLED
for newer versions.https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-26.html#mysqld-8-0-26-deprecation-removal
https://dev.mysql.com/doc/relnotes/mysql/8.4/en/news-8-4-0.html#mysqld-8-4-0-deprecation-removal
https://dev.mysql.com/doc/refman/8.4/en/connection-options.html#option_general_ssl-mode
An alternative to this might be a generic
LARAVEL_LOAD_(MYSQL|MARIADB|POSTGRES|SQLITE)_OPTS=
env var that allows any custom options/flags to be added to the load command.