如何修复 docker MariaDB mysql: executable file not found in $PATH: unknown
问题:
你想在 MariaDB docker 容器中运行 mysql 命令,如
docker_compose_exec_mysql.sh
docker-compose exec -T mariadb mysql -uroot -p${MARIADB_ROOT_PASSWORD} mydatabase < dump.sql但你看到以下错误消息:
oci_error.txt
OCI runtime exec failed: exec failed: unable to start container process: exec: "mysql": executable file not found in $PATH: unknown解决方案
对于较新的 MariaDB 容器版本,mysql 可执行文件不再存在。将 mysql 替换为 mariadb 来修复问题,例如:
docker_compose_exec_mariadb.sh
docker-compose exec -T mariadb mariadb -uroot -p${MARIADB_ROOT_PASSWORD} mydatabase < dump.sqlCheck out similar posts by category:
Container
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow