Skip to content

wp-cli returns FAIL notice when using mariadb symlinked mysql* commands; request for native mdb support #271

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

Closed
pgnd opened this issue Aug 31, 2024 · 12 comments · Fixed by #275

Comments

@pgnd
Copy link

pgnd commented Aug 31, 2024

i've installed

wp-cli  cli info
	OS:     Linux 6.10.6-200.fc40.x86_64 wp-cli/wp-cli#1 SMP PREEMPT_DYNAMIC Mon Aug 19 14:09:30 UTC 2024 x86_64
	Shell:  /bin/bash
	PHP binary:     /usr/bin/php
	PHP version:    8.3.11
	php.ini used:   /usr/local/etc/php8/php.ini
	MySQL binary:
	MySQL version:
	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:       /srv/my.app
	WP-CLI packages dir:    /var/lib/wwwrun/.wp-cli/packages/
	WP-CLI cache dir:       /var/lib/wwwrun/.wp-cli/cache
	WP-CLI global config:   /var/lib/wwwrun/.wp-cli/config.yml
	WP-CLI project config:  /srv/my.app/wp-cli.yml
	WP-CLI version: 2.11.0

i use mariadb

rpm -qa | grep -Ei "^mysql|^mariadb"
	mariadb-sysusers-git_1.0-0.20240812_133520.fc40.noarch
	mariadb-lts-git_11.4-0.20240812_133724.fc40.x86_64
	mariadb-connector-j-git_3.3.1-0.20240812_133547.fc40.noarch

mariadb -V
	mariadb from 11.4.4-MariaDB, client 15.2 for Linux (x86_64) using readline 5.1

where

echo $PATH
	/usr/local/mariadb-lts/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

which mariadb
	/usr/local/mariadb-lts/bin/mariadb

and the mysql-equivalent commands are provided as symlinks

cd /usr/local/mariadb-lts/bin
ls -l mysql* | awk '{print $9, "->", $NF}'
	mysql -> mariadb*
	mysqlaccess -> mariadb-access*
	mysqladmin -> mariadb-admin*
	mysqlbinlog -> mariadb-binlog*
	mysqlcheck -> mariadb-check*
	mysql_client_test -> mariadb-client-test*
	mysql_config* -> mysql_config*
	mysql_convert_table_format -> mariadb-convert-table-format*
	mysqld_multi -> mariadbd-multi*
	mysqld_safe -> mariadbd-safe*
	mysqld_safe_helper -> mariadbd-safe-helper*
	mysqldump -> mariadb-dump*
	mysqldumpslow -> mariadb-dumpslow*
	mysql_find_rows -> mariadb-find-rows*
	mysql_fix_extensions -> mariadb-fix-extensions*
	mysqlhotcopy -> mariadb-hotcopy*
	mysqlimport -> mariadb-import*
	mysql_install_db -> mariadb-install-db*
	mysql_plugin -> mariadb-plugin*
	mysql_secure_installation -> mariadb-secure-installation*
	mysql_setpermission -> mariadb-setpermission*
	mysqlshow -> mariadb-show*
	mysqlslap -> mariadb-slap*
	mysqltest -> mariadb-test*
	mysql_tzinfo_to_sql -> mariadb-tzinfo-to-sql*
	mysql_upgrade -> mariadb-upgrade*
	mysql_waitpid -> mariadb-waitpid*

on exec, wp-cli returns deprecation warnings

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

"Remove MySQL names"
https://jira.mariadb.org/browse/MDEV-30201

"deprecate mysql* names"
https://jira.mariadb.org/browse/MDEV-29582

it'll be useful to get native mariadb command support in wp-cli.

@pgnd pgnd 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 Aug 31, 2024
@pgnd pgnd 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 Aug 31, 2024
@pgnd
Copy link
Author

pgnd commented Aug 31, 2024

not just warnings, but failures

where

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

@swissspidy swissspidy transferred this issue from wp-cli/wp-cli Aug 31, 2024
@swissspidy
Copy link
Member

Isn't this a duplicate of #270, which you opened 2 weeks ago?

@pgnd
Copy link
Author

pgnd commented 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.

ton31337 added a commit to ton31337/db-command that referenced this issue Nov 8, 2024
With this fix:

```
% ./vendor/bin/wp db check --path=/tmp/wordpress
mariadb-check: ...
```

Issue: wp-cli#271

Signed-off-by: Donatas Abraitis <[email protected]>
ton31337 added a commit to ton31337/db-command that referenced this issue Nov 8, 2024
With this fix:

```
% ./vendor/bin/wp db check --path=/tmp/wordpress
mariadb-check: ...
```

Issue: wp-cli#271

Signed-off-by: Donatas Abraitis <[email protected]>
ton31337 added a commit to ton31337/db-command that referenced this issue Nov 8, 2024
With this fix:

```
% ./vendor/bin/wp db check --path=/tmp/wordpress
mariadb-check: ...
```

Issue: wp-cli#271

Signed-off-by: Donatas Abraitis <[email protected]>
ton31337 added a commit to ton31337/db-command that referenced this issue Nov 8, 2024
With this fix:

```
% ./vendor/bin/wp db check --path=/tmp/wordpress
mariadb-check: ...
```

Issue: wp-cli#271

Signed-off-by: Donatas Abraitis <[email protected]>
ton31337 added a commit to ton31337/db-command that referenced this issue Nov 8, 2024
With this fix:

```
% ./vendor/bin/wp db check --path=/tmp/wordpress
mariadb-check: ...
```

Issue: wp-cli#271

Signed-off-by: Donatas Abraitis <[email protected]>
ton31337 added a commit to ton31337/db-command that referenced this issue Nov 8, 2024
With this fix:

```
% ./vendor/bin/wp db check --path=/tmp/wordpress
mariadb-check: ...
```

Issue: wp-cli#271

Signed-off-by: Donatas Abraitis <[email protected]>
ton31337 added a commit to ton31337/db-command that referenced this issue Nov 8, 2024
With this fix:

```
% ./vendor/bin/wp db check --path=/tmp/wordpress
mariadb-check: ...
```

Issue: wp-cli#271

Signed-off-by: Donatas Abraitis <[email protected]>
ton31337 added a commit to ton31337/db-command that referenced this issue Nov 8, 2024
With this fix:

```
% ./vendor/bin/wp db check --path=/tmp/wordpress
mariadb-check: ...
```

Issue: wp-cli#271

Signed-off-by: Donatas Abraitis <[email protected]>
ton31337 added a commit to ton31337/db-command that referenced this issue Nov 8, 2024
First look for a symlink and use it if it exists, otherwise use a given command.

With this fix:

```
% ./vendor/bin/wp db check --path=/tmp/wordpress
mariadb-check: ...
```

Issue: wp-cli#271

Signed-off-by: Donatas Abraitis <[email protected]>
ton31337 added a commit to ton31337/db-command that referenced this issue Nov 8, 2024
First look for a symlink and use it if it exists, otherwise use a given command.

With this fix:

```
% ./vendor/bin/wp db check --path=/tmp/wordpress
mariadb-check: ...
```

Issue: wp-cli#271

Signed-off-by: Donatas Abraitis <[email protected]>
ton31337 added a commit to ton31337/db-command that referenced this issue Nov 8, 2024
First look for a symlink and use it if it exists, otherwise use a given command.

With this fix:

```
% ./vendor/bin/wp db check --path=/tmp/wordpress
mariadb-check: ...
```

Issue: wp-cli#271

Signed-off-by: Donatas Abraitis <[email protected]>
Signed-off-by: Donatas Abraitis <[email protected]>
ton31337 added a commit to ton31337/db-command that referenced this issue Nov 8, 2024
First look for a symlink and use it if it exists, otherwise use a given command.

With this fix:

```
% ./vendor/bin/wp db check --path=/tmp/wordpress
mariadb-check: ...
```

Issue: wp-cli#271

Signed-off-by: Donatas Abraitis <[email protected]>
Signed-off-by: Donatas Abraitis <[email protected]>
ton31337 added a commit to ton31337/db-command that referenced this issue Nov 8, 2024
First look for a symlink and use it if it exists, otherwise use a given command.

With this fix:

```
% ./vendor/bin/wp db check --path=/tmp/wordpress
mariadb-check: ...
```

Issue: wp-cli#271

Signed-off-by: Donatas Abraitis <[email protected]>
Signed-off-by: Donatas Abraitis <[email protected]>
ton31337 added a commit to ton31337/db-command that referenced this issue Nov 8, 2024
First look for a symlink and use it if it exists, otherwise use a given command.

With this fix:

```
% ./vendor/bin/wp db check --path=/tmp/wordpress
mariadb-check: ...
```

Issue: wp-cli#271

Signed-off-by: Donatas Abraitis <[email protected]>
Signed-off-by: Donatas Abraitis <[email protected]>
@ton31337
Copy link

@pgnd could you check this patch #274?

mrsdizzie added a commit to mrsdizzie/db-command that referenced this issue Nov 14, 2024
The compatibility links MariaDB provides for MySQL commands are
depracated and will be removed in the future. We should use the MariaDB
command name if that is the current MySQL provider.

Fixes wp-cli#271
mrsdizzie added a commit to mrsdizzie/db-command that referenced this issue Nov 14, 2024
The compatibility links MariaDB provides for MySQL commands are
deprecated and will be removed in the future. We should use the MariaDB
command name if that is the current MySQL provider.

Fixes wp-cli#271
@Vilasamuni
Copy link

This issue is still present on the latest wp-cli image from https://hub.docker.com/_/wordpress

/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

The db export command is also affected

@thekendog
Copy link

thekendog commented 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
Copy link
Member

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
Copy link

So there's just no workaround right now? That's a bummer.

@Vilasamuni

This comment has been minimized.

@swissspidy
Copy link
Member

As I said, we‘ll probably open a new issue.

@Vilasamuni
Copy link

Sorry I missed that bit! I've hidden my previous comment.

@swissspidy
Copy link
Member

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.

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 a pull request may close this issue.

5 participants