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

Install matching mysql/mysqldump client inside ddev-webserver based on mysql or mariadb database type #6083

Open
rfay opened this issue Apr 11, 2024 · 2 comments

Comments

@rfay
Copy link
Member

rfay commented Apr 11, 2024

In general, the mysql client shipped with the ddev-webserver works fine with all mariadb and mysql back-end databases.

However, there are a few cases where their behavior is slightly different.

And the fact that the mysql client reports a different version is often confusing to people.

For example, with database mysql:8.0 we see these outputs:

rfay@rfay-mbp-2021:~/workspace/d10$ ddev exec mysql --version
mysql  Ver 15.1 Distrib 10.11.6-MariaDB, for debian-linux-gnu (aarch64) using  EditLine wrapper

rfay@rfay-mbp-2021:~/workspace/d10$ ddev exec -s db mysql --version
mysql  Ver 8.0.33-0ubuntu0.20.04.2 for Linux on aarch64 ((Ubuntu))

The web container has the mariadb version, and the db container has the mysql:8.0 version.

On Craft CMS and perhaps some other places, people have the habit of using the built-in tools; Craft actually calls out to the mysql client (on ddev-webserver) rather than connecting directly to the database server, so this can cause confusion there.

Proposal

Add a layer to the ddev-webserver adding a matching mysql client to the ddev-webserver, especially where the database type is mysql:8.0, which is the most likely place for concern.

It also might be possible to implement this as an add-on for the few people it matters to. It's tricky getting the proper match between the OS-provided mysql client and the ddev-webserver, and it could introduce instabilities.

@rfay rfay changed the title Install matching mysql client inside ddev-webserver based on mysql or mariadb database type Install matching mysql/mysqldump client inside ddev-webserver based on mysql or mariadb database type Apr 11, 2024
@stasadev
Copy link
Member

stasadev commented Apr 30, 2024

Answering to #6139 (comment) in the relevant issue:

Is there something like that where we can get the mysql version of the client also?

There is mysql-apt-config https://dev.mysql.com/doc/refman/8.4/en/linux-installation-apt-repo.html

The current latest version is 0.8.30 https://dev.mysql.com/get/mysql-apt-config_0.8.30-1_all.deb

How to install mysql-server in non-interactive way https://stackoverflow.com/a/37267411/8097891

The SO example needs to be modified to change the server to client, but I think it's an achievable goal.

@rfay
Copy link
Member Author

rfay commented Apr 30, 2024

I'm not sure there's a client package, but if there is this can be great!

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

No branches or pull requests

2 participants