gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-29 01:35:23 29 4
gpt4 key购买 nike

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

docker-compose exec MYSQL_CONTAINERNAME mysql -uroot -p --database=MY_DB < /code/export_new.sql

但是我有消息“docker-compose exec -i MYSQL_CONTAINER NAME mysql -uroot -p --database=MY_DB

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 a service [default: 1]
-e, --env KEY=VAL Set environment variables (can be used multiple times,
not supported in API < 1.25)
-w, --workdir DIR Path to workdir directory for this command.

如何将我的“export_new.sql”导入容器中的mysql?

最佳答案

为我工作

docker-compose exec -T MYSQL_CONTAINERNAME mysql databasename < data.sql

关于mysql - docker-compose mysql 导入失败 - 输入设备不是 TTY,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50528521/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com