wp-cli / db-command

Performs basic database operations using credentials stored in wp-config.php.
MIT License
71 stars 59 forks source link

wp-cli missing support for native mariadb cmds (-dump,-check,etc); current DEPRECATION notices #270

Closed pgnd closed 3 months ago

pgnd commented 3 months ago

on wp running with a local mariadb install

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

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

which mariadb-dump mariadb-check mysqldump mysqlcheck
    /usr/local/mariadb-lts/bin/mariadb-dump
    /usr/local/mariadb-lts/bin/mariadb-check
    /usr/local/mariadb-lts/bin/mysqldump
    /usr/local/mariadb-lts/bin/mysqlcheck

running

wp-cli cli version
    WP-CLI 2.11.0

wp-cli core version
    6.6.1

exec

wp-cli db check
    /usr/bin/env: ‘mysqlcheck’: No such file or directory

wp-cli db export wpcli-db-dump.sql
    /usr/bin/env: ‘mysqldump’: No such file or directory
    /usr/bin/env: ‘mysqldump’: No such file or directory

easy tmp fix for default install

ln -sf /usr/local/mariadb-lts/bin/mysqldump /usr/local/bin/
ln -sf /usr/local/mariadb-lts/bin/mysqlcheck /usr/local/bin/

now

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
    test.wp_commentmeta               OK
    ...
    Success: Database checked.

wp-cli db export wpcli-db-dump.sql
    mysqldump: Deprecated program name. It will be removed in a future release, use '/usr/local/mariadb-lts/bin/mariadb-dump' instead
    mysqldump: Deprecated program name. It will be removed in a future release, use '/usr/local/mariadb-lts/bin/mariadb-dump' instead

ls -al wpcli-db-dump.sql
    -rw-rw----+ 1 wwwrun www 1.7M Aug 17 14:29 wpcli-db-dump.sql

noted & fixed, e.g., @ drush proj

https://github.com/drush-ops/drush/issues/5777
https://github.com/drush-ops/drush/pull/5787

not urgent at all. would be a convenient cleanup to support both native mariadb- &/or mysql cmds.

pgnd commented 3 months ago

forgot i'd posted this. mv to #271