As specified in MariaDB docker documentation, since mariadb:11 (mariadb:latest) has no mysql
executable or symlink. mariadb
is the official command line executable. Use of a mysql
named executable will result in a deprecation warning.
https://mariadb.com/kb/en/mariadb-11-0-1-release-notes/#docker-official-images
To keep compatibility with existing scripts you can fix the docker image version number to a previous release that supports the mysql
command, like mariadb:10.4
EDIT: To use the latest version (or any 10.5+
version) you should:
- Rename calls to
mysql
command in any related script to mariadb
,
- Create a command alias in your script or
~/.bashrc
file
alias mysql=/usr/bin/mariadb
,
- Add a line to the mariadb
Dockerfile
to create a 'wrapper' script
RUN echo '#!/bin/bash' > /usr/bin/mysql && echo 'mariadb "$@"' >> /usr/bin/mysql && chmod +x /usr/bin/mysql
Note: Creating a symbolic link from /usr/bin/mariadb
to /usr/bin/mysql
will trigger a warning from the command execution:
mysql: Deprecated program name. It will be removed in a future release, use '/usr/bin/mariadb' instead