gpt4 book ai didi

mysql - 尝试将转储文件还原到mysql docker镜像时发生错误

转载 作者:行者123 更新时间:2023-12-02 19:14:37 25 4
gpt4 key购买 nike

cross post
嗨,这很奇怪,因为它始终对我有用,现在我不断遇到错误:

ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘mysqldump: [Warning] Using a password on the command line interface can be insec’ at line 1


然后我复制并粘贴 docs中的命令:
$ docker exec -i some-mysql sh -c 'exec mysql -uroot -p"$MYSQL_ROOT_PASSWORD"' < /some/path/on/your/host/all-databases.sql
然后,我将其编辑为:
$ docker exec -i sql-db sh -c 'exec mysql -uroot -p"super_secret_pw" users' < ./source.sql
还:在 $ docker ps之后我得到:
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                               NAMES
8fa9cb82332e mysql:5.7 "docker-entrypoint.s…" 20 minutes ago Up 20 minutes 0.0.0.0:3306->3306/tcp, 33060/tcp sql-db
我收到上述错误。谢谢你的帮助

最佳答案

所以问题在于,在转储的顶部,第一行的文本是:

1   mysqldump: [Warning] Using a password on the command line interface can be insecure.

关于mysql - 尝试将转储文件还原到mysql docker镜像时发生错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64119304/

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