drush
drush copied to clipboard
D7 installation fails with Drush 8.x: Incorrect table name 'mysql: Deprecated program name. It will be removed in a future release, use '/usr/bin/mariadb' instead
Describe the bug Drupal 7 installation fails when using latest stable mariadb-client (Alpine 3.21)
To Reproduce
- Clone D7 from https://github.com/drupal-composer/drupal-project.git
- Install via Drush
drush si
Expected behavior Installation completes without errors
Actual behavior Error thrown
System Configuration
| Q | A |
|---|---|
| Drush version? | 8.5.0 |
| Drupal version? | 7.x |
| PHP version | 8.x |
| OS? | Linux |
Additional information
Executing: mysql --defaults-extra-file=/tmp/drush_fdoGcc --database=drupal --host=mariadb --silent < /tmp/drush_jbNBcc > /dev/null
Notice: y: SHOW TABLES; [0.14 sec, 7.46 MB] [notice]
Executing: mysql --defaults-extra-file=/tmp/drush_hDkIad --database=drupal --host=mariadb --silent < /tmp/drush_JLiEad
mysql: Deprecated program name. It will be removed in a future release, use '/usr/bin/mariadb' instead
Notice: y: DROP TABLE `mysql: Deprecated program name. It will be [notice]
removed in a future release, use '/usr/bin/mariadb' instead` [0.17
sec, 7.47 MB]
Executing: mysql --defaults-extra-file=/tmp/drush_fLmGfg --database=drupal --host=mariadb --silent < /tmp/drush_gMdBfg
Error: to create database: mysql: Deprecated program name. It will be [error]
removed in a future release, use '/usr/bin/mariadb'
instead--------------DROP TABLE `mysql: Deprecated program name. It
will be removed in a future release, use '/usr/bin/mariadb'
instead`--------------ERROR 1103 (42000) at line 1: Incorrect table
name 'mysql: Deprecated program name. It will be removed in a
future release, use '/usr/bin/mariadb' inste' [0.2
sec, 7.47 MB]
Returned from hook drush_core_pre_site_install [0.2 sec, 7.47 MB] [debug]
Notice: dispatch complete [0.2 sec, 7.42 MB] [notice]
mysql: Deprecated program name. It will be removed in a future release, use '/usr/bin/mariadb' instead
--------------
DROP TABLE `mysql: Deprecated program name. It will be removed in a future release, use '/usr/bin/mariadb' instead`
--------------
ERROR 1103 (42000) at line 1: Incorrect table name 'mysql: Deprecated program name. It will be removed in a future release, use '/usr/bin/mariadb' inste'
Same issue when I want to import db for the same reason.
drush sql:cli < ../backup.sql :
In Process.php line 270:
The command "mysql --defaults-file=/tmp/drush_KblbgB --database=drupal --ho
st=mariadb --port=3306 -A" failed.
Exit Code: 1(General error)
Working directory: /var/www/html/drupal/web
Output:
================
Error Output:
================
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
In my case I didn't see the SSL error which was discussed in https://github.com/wodby/drupal-php/issues/104
In both cases it was an TLS/SSL error, but the deprecated warning remains.
Following finding of https://github.com/ddev/ddev/issues/6861, the deprecation warning comes from the binary not starting with mariadb.
And I like the quote from stasadev
if MariaDB wants to distance itself from MySQL, we should not hide it under aliases or functions
Or is the less intrusive way for, "if binary mariadb exists, use that" a better approach?
PRs welcome; however, we must be mindful to not break older installations that are still using mysql.
Since 2018 (the licence change of Oracle) mysql-client is a wrapper/alias/... for mariadb-client For example the Alpine web interface shows this well: https://pkgs.alpinelinux.org/package/edge/main/x86/mysql-client There it requires mariadb-client, and provides no binaries to the path.
If you add the Oracle repository, and install mysql-client of them, you will not get mairadb-client Therefor my suggested approach is to follow the "if binary existst" flow that has been implemented here before https://github.com/drush-ops/drush/pull/5787/files#diff-10f1c3eb1bfecf60e08f33df32da80b7f586d992637f4fde660fed01f0161c52R15
Can make a proof-of-concept PR