【发布时间】:2017-08-15 12:51:44
【问题描述】:
在我的 EC2 Linux 中,我想创建一个 cron 作业来自动备份 AWS RDS 中的 MySql 数据库。我曾尝试运行
/usr/bin/mysqldump -u dbusername -p'dbpassword' dbname > /path/backup.sql
但我遇到了一个错误
"Warning: Using a password on the command line interface can be insecure.
mysqldump: Got error: 1045: Access denied for user 'dbusername'@'localhost' (using password: YES) when trying to connect".
出了什么问题,如何将 'dbusername'@'localhost' 更改为 'dbusername'@'xxx.xxxxxxxx.xx-xxxxxx-x.rds.amazonaws.com'?
我也曾尝试编写一个 MySql 脚本来下载 backup.sh 但无法超越,因为它无法超越
mysql -u 'dbusername' --password="dbpassword" -h 'xxx.xxxxxxxx.xx-xxxxxx-x.rds.amazonaws.com'
它可以登录,但它显示 MySQL 提示符
>
除此之外的任何东西,例如
> use db;
它会显示
Warning: Using a password on the command line interface can be insecure.
【问题讨论】:
-
您需要备份 RDS 数据库实例还是对运行在 EC2 实例内的数据库执行 ETL 作业?
-
我的要求是在 EC2 中做一个 cron 作业来备份在 RDS @Ashan 中运行的数据库
标签: mysql linux amazon-web-services amazon-ec2 amazon-rds