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

MySQL 使用 mysqldump 导出数据库提示:

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

解决办法:

cat > /tmp/myconfig.cnf <<EOF
[client]
user = "root"
password = "123456"
EOF

docker cp /tmp/myconfig.cnf mysql:/tmp/

# 再次导出没有提示了(这里我是导出并压缩)
docker exec -it mysql mysqldump --defaults-extra-file=/tmp/myconfig.cnf -uroot dbname | gzip > /tmp/dbname.sql.gz

# 解压:
gzip -d /tmp/dbname.sql.gz

版权声明:
作者:admin
链接:https://www.chenxie.net/archives/2714.html
来源:蜀小陈
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
< <上一篇
下一篇>>
文章目录
关闭
目 录