Reputation: 53
In docker container running mysql commands results in a
bash: mysql: command not found error
mysql --version, or any mysql command; same issue.
Adding mysql-client did not help. Suggestions about adding default-libmysqlclient-dev
apt-get install --no-install-recommends -y default-libmysqlclient-dev
Still no able to run mysql.
Upvotes: 2
Views: 318
Reputation: 53
This helped.
For newer MariaDB container versions, the mysql executable does not exist any more. Replace mysql with mariadb to fix the issue, for example:
All info online states mysql in command. For mariadb image it is maridb for any command eg.
docker-compose exec -T mariadb mariadb -uroot -p
Note for the client not installed, mariadb image has it
using this to test:
mariadb --version
Shows client present
mariadb from 11.3.2-MariaDB, client 15.2 for debian-linux-gnu (x86_64) using EditLine wrapper
Upvotes: 2