You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
wp-cli returns FAIL notice when using mariadb symlinked mysql* commands; request for native mdb support #271
wp-cli db check
mysqlcheck: Deprecated program name. It will be removed in a future release, use '/usr/local/mariadb-lts/bin/mariadb-check' instead
...
currently, the wp-cli return with the deprecation notice causes some grief mainly with scripts.
but it will likely, eventually break.
as mysql/mariadb continue to diverge, MDB's deprecating the mysql* cmds.
not entirely sure where the end of the thread is, but these are a start
changed the title [-]wp-cli returns deprecation notice when using mariadb symlinked mysql* commands; request for native mdb support[/-][+]wp-cli returns ~~deprecation~~ FAIL notice when using mariadb symlinked mysql* commands; request for native mdb support[/+]on Aug 31, 2024
changed the title [-]wp-cli returns ~~deprecation~~ FAIL notice when using mariadb symlinked mysql* commands; request for native mdb support[/-][+]wp-cli returns FAIL notice when using mariadb symlinked mysql* commands; request for native mdb support[/+]on Aug 31, 2024
ls -al `which mysql`
lrwxrwxrwx 1 root root 7 Aug 11 20:00 /usr/local/mariadb-lts/bin/mysql -> mariadb*
and
DB_NAME=$(wp-cli config get DB_NAME)
SITE_URL=$(wp-cli option get siteurl)
SITE_NAME=$(wp-cli option get blogname)
THEME_NAME=$(wp-cli theme list --status=active --field=name)
this works
SQL_QUERY="SELECT * FROM wp_options WHERE option_value LIKE '%$SITE_URL%' OR option_value LIKE '%$SITE_NAME%' OR option_value LIKE '%$THEME_NAME%';"
mariadb ${DB_NAME} -e "$SQL_QUERY"
as does
mysql ${DB_NAME} -e "$SQL_QUERY"
but,
wp-cli db query "${SQL_QUERY}"
Error: Failed to get current SQL modes. Reason: /usr/bin/env: ‘mysql’: No such file or directory
/var/www/html` $ wp cli info
OS: Linux 6.11.0-19-generic #19~24.04.1-Ubuntu SMP PREEMPT_DYNAMIC Mon Feb 17 11:51:52 UTC 2 x86_64
Shell:
PHP binary: /usr/local/bin/php
PHP version: 8.2.27
php.ini used:
MySQL binary: /usr/bin/mysql
MySQL version: mysql from 11.4.4-MariaDB, client 15.2 for Linux (x86_64) using readline 5.1
SQL modes:
WP-CLI root dir: phar://wp-cli.phar/vendor/wp-cli/wp-cli
WP-CLI vendor dir: phar://wp-cli.phar/vendor
WP_CLI phar path: /var/www/html
WP-CLI packages dir:
WP-CLI cache dir: /.wp-cli/cache
WP-CLI global config:
WP-CLI project config:
WP-CLI version: 2.11.0
/var/www/html $ wp db import ../backups/db-prod.sql
Error: Failed to get current SQL modes. Reason: mysql: Deprecated program name. It will be removed in a future release, use '/usr/bin/mariadb' instead
ERROR 2026 (HY000): TLS/SSL error: SSL is required, but the server does not support it
Yeah I'm getting this issue still. What's the fix? WP-CLI is pretty much useless right now if you are using MariaDB 11 and trying to do anything with the DB.
We've just recently discussed this again in #280, as we also need to figure out what to do if both MySQL and MariaDB are installed. We might open a new issue for that for visibility.
So we just made some significant improvements in #6072 and in the main framework repo. We expect these issues to be resolved in the upcoming WP-CLI v2.12 release.
Reacted by Vilasamuni, Luis Rosales and Daniel Katz
@swissspidy That is awesome! I just saw the new version was released recently, but i'm still getting the error when trying to import a database via wp cli:
[+] Creating 1/1
✔ Container test-db-1 Running 0.0s
Error: Failed to get current SQL modes. Reason: ERROR 2026 (HY000): TLS/SSL error: SSL is required, but the server does not support it
@basgrave This issue here was about Deprecated program name. warnings, which is what we fixed in the latest release. Your error is about TLS/SSL, which is unrelated to that. I think that's being tracked in #278. Note that, depending on the command, you can pass flags such as --ssl which are forwarded to the MySQL command.
Activity
[-]wp-cli returns deprecation notice when using mariadb symlinked mysql* commands; request for native mdb support[/-][+]wp-cli returns ~~deprecation~~ FAIL notice when using mariadb symlinked mysql* commands; request for native mdb support[/+][-]wp-cli returns ~~deprecation~~ FAIL notice when using mariadb symlinked mysql* commands; request for native mdb support[/-][+]wp-cli returns FAIL notice when using mariadb symlinked mysql* commands; request for native mdb support[/+]pgnd commentedon Aug 31, 2024
not just warnings, but failures
where
and
this works
as does
but,
swissspidy commentedon Aug 31, 2024
Isn't this a duplicate of #270, which you opened 2 weeks ago?
pgnd commentedon Aug 31, 2024
@swissspidy
ugh. 🤦 completely forgot that! sorry for the noise ...
i'll close THAT and leave THIS, since I'm dealing with the FAILs now.
Handle MySQL commands without deprecation warnings
Handle MySQL commands without deprecation warnings
Handle MySQL commands without deprecation warnings
Handle MySQL commands without deprecation warnings
Handle MySQL commands without deprecation warnings
Handle MySQL commands without deprecation warnings
Handle MySQL commands without deprecation warnings
Handle MySQL commands without deprecation warnings
Handle MySQL commands without deprecation warnings
8 remaining items
Vilasamuni commentedon Mar 11, 2025
This issue is still present on the latest wp-cli image from https://hub.docker.com/_/wordpress
The
db exportcommand is also affectedthekendog commentedon Mar 16, 2025
Yeah I'm getting this issue still. What's the fix? WP-CLI is pretty much useless right now if you are using MariaDB 11 and trying to do anything with the DB.
swissspidy commentedon Mar 17, 2025
We've just recently discussed this again in #280, as we also need to figure out what to do if both MySQL and MariaDB are installed. We might open a new issue for that for visibility.
thekendog commentedon Mar 17, 2025
So there's just no workaround right now? That's a bummer.
Vilasamuni commentedon Mar 17, 2025
swissspidy commentedon Mar 17, 2025
As I said, we‘ll probably open a new issue.
Vilasamuni commentedon Mar 17, 2025
Sorry I missed that bit! I've hidden my previous comment.
swissspidy commentedon Mar 28, 2025
So we just made some significant improvements in #6072 and in the main framework repo. We expect these issues to be resolved in the upcoming WP-CLI v2.12 release.
basgrave commentedon May 12, 2025
@swissspidy That is awesome! I just saw the new version was released recently, but i'm still getting the error when trying to import a database via wp cli:
[+] Creating 1/1
✔ Container test-db-1 Running 0.0s
Error: Failed to get current SQL modes. Reason: ERROR 2026 (HY000): TLS/SSL error: SSL is required, but the server does not support it
swissspidy commentedon May 12, 2025
@basgrave This issue here was about
Deprecated program name.warnings, which is what we fixed in the latest release. Your error is about TLS/SSL, which is unrelated to that. I think that's being tracked in #278. Note that, depending on the command, you can pass flags such as--sslwhich are forwarded to the MySQL command.thekendog commentedon May 12, 2025
Updated to 2.12 on an older server. Centos 7. I now get this error when trying to do a DB export.
/usr/bin/env: mariadb-dump: No such file or directory
swissspidy commentedon May 12, 2025
Mind opening a new issue for that please?
Judapriest commentedon Jun 5, 2025
Got the same error.
Check you mariadb version.
mariadb-dump was introduced on 10.5.
I was on 10.3.
In the recent version of wp-cli, its look for mariadb-dump instead of mysql-dump when it deteted mariadb.
PS : please note that mariadb 10.5 is support until 16 July 2025 (~1 month).
source : https://endoflife.date/mariadb
swissspidy commentedon Jun 5, 2025
@Judapriest see wp-cli/wp-cli#6097