Skip to content

Conversation

@swissspidy
Copy link
Member

See:

MariaDB currently adds symlinks for mysql to use mariadb under the hood, but that is being deprecated and people get warnings like Deprecated program name. It will be removed in a future release, use 'mariadb' instead

With this change, the idea is to offer better utils for commands like db-command to pick the right binary.

I suppose that could imply that we officially support MariaDB, but I guess since WordPress core itself recommends it, we should at least test it.

@swissspidy swissspidy requested a review from a team as a code owner March 26, 2025 15:57
@swissspidy
Copy link
Member Author

@mrsdizzie @schlessera curious to hear your thoughts

@codecov
Copy link

codecov bot commented Mar 26, 2025

Codecov Report

Attention: Patch coverage is 0% with 42 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
php/utils.php 0.00% 42 Missing ⚠️

📢 Thoughts on this report? Let us know!

@mrsdizzie
Copy link
Member

Maybe it could be good to have one of the test runs use Mariadb instead of MySQL as well?

@swissspidy
Copy link
Member Author

Yes, see wp-cli/.github#123

Feel free to submit a PR :)

@swissspidy swissspidy merged commit aeae871 into main Mar 28, 2025
26 of 51 checks passed
@swissspidy swissspidy deleted the try/mariadb-detection branch March 28, 2025 12:17
@tmuka
Copy link

tmuka commented Oct 6, 2025

It seems like this change may have introduced a hiccup in our workflow with wp-cli and mariadb.

in my wordpress docker container i'm running
sudo --preserve-env /bin/wp-cli.phar --color --allow-root --skip-ssl --skip-plugins --skip-themes --debug db import remote.sql

Debug (db): Final MySQL command: /usr/bin/env mariadb --no-defaults --no-auto-rehash --batch --skip-column-names --host='db' --user='wordpress_user' --default-character-set='utf8' --execute='SELECT @@SESSION.sql_mode' (0.061s)
Error: Failed to get current SQL modes. Reason: ERROR 2026 (HY000): TLS/SSL error: SSL is required, but the server does not support it.

I dug a little deeper to find a little more debugging info. running the command diretly shows the same error

root@2fdd893ad051:/var/www/html#  /usr/bin/env mariadb --no-defaults --no-auto-rehash --batch --skip-column-names --host='db' --user='wordpress_user' --default-character-set='utf8' --execute='SELECT @@SESSION.sql_mode'
ERROR 2026 (HY000): TLS/SSL error: SSL is required, but the server does not support it

i read adding the arg --port='3306' could help. that gets me a different error.

root@2fdd893ad051:/var/www/html#  /usr/bin/env mariadb --no-defaults --no-auto-rehash --batch --skip-column-names --host='db' --port='3306' --user='wordpress_user' --default-character-set='utf8' --execute='SELECT @@SESSION.sql_mode'
WARNING: option --ssl-verify-server-cert is disabled, because of an insecure passwordless login.
ERROR 1045 (28000): Access denied for user 'wordpress_user'@'172.18.0.4' (using password: NO)

from there, it does work if i also add the "--password=blah" arg.

Has anyone else overcome this in their workflow with docker+mariadb+wp-cli and can offer help?

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 this pull request may close these issues.

4 participants