我使用官方的MySQL docker镜像,但在导出数据时遇到了错误。我按照以下方式运行导出命令:
I use the official MySQL docker image, and I am having difficulty exporting data from the instance without errors. I run my export like this:
docker run -it --link containername:mysql --rm mysql sh -c
'exec mysqldump
-h"$MYSQL_PORT_3306_TCP_ADDR"
-P"$MYSQL_PORT_3306_TCP_PORT" -uroot
-p"$MYSQL_ENV_MYSQL_ROOT_PASSWORD"
dbname'
| gz > output.sql.gz
但是,这会导致警告:
"mysqldump: [Warning] Using a password on the command line interface can be insecure."
作为输出文件的第一行。很明显,这会对消费数据的任何其他 MySQL 进程造成问题。
有没有办法从 mysqldump 客户端抑制此警告?