小编Rom*_*man的帖子

docker-compose mysql 导入失败 - 输入设备不是 TTY

我有任何正在运行的容器。所以我需要导入 sql 数据库并尝试

docker-compose exec MYSQL_CONTAINERNAME mysql -uroot -p --database=MY_DB < /code/export_new.sql
Run Code Online (Sandbox Code Playgroud)

但是我有消息“docker-compose exec -i MYSQL_CONTAINER NAME mysql -uroot -p --database=MY_DB < /code/export_new.sql”如果我在之后使用“-i”或“-T”或“-it”参数命令“... exec”我有消息:

Usage: exec [options] [-e KEY=VAL...] SERVICE COMMAND [ARGS...]

Options:
    -d, --detach      Detached mode: Run command in the background.
    --privileged      Give extended privileges to the process.
    -u, --user USER   Run the command as this user.
    -T                Disable pseudo-tty allocation. By default `docker-compose exec`
                      allocates a TTY.
    --index=index     index of the container if there are multiple
                      instances of …
Run Code Online (Sandbox Code Playgroud)

mysql docker docker-compose

7
推荐指数
2
解决办法
2998
查看次数

标签 统计

docker ×1

docker-compose ×1

mysql ×1