发布网友 发布时间:2022-04-11 04:22
共3个回答
懂视网 时间:2022-04-11 08:43
10 0 1 * * bash /var/www/borg/fuel/app/tasks/db_backup.sh SAVE_PATH="/var/tmp/" ymdhms=$(date +%Y%m%d%H%M%S) dump_file_name="backup_${ymdhms}.dump" if [[ $BORG_FUEL_BATCH_ENV == "development" ]] then dbuser="root" dbpasswd=‘!Test1234#‘ db=test_ph0_dev elif [[ $TEST_FUEL_BATCH_ENV == "staging" ]] then dbuser="test" dbpasswd=‘Test-123‘ db=test_ph0_stg else dbuser="test" dbpasswd=‘Test-123‘ db=test_ph0_prd fi echo $TEST_FUEL_BATCH_ENV backup_command="mysqldump --single-transaction -u ${dbuser} -p‘${dbpasswd}‘ ${db} > ${SAVE_PATH}${dump_file_name}" echo $backup_command#command3
#result=`mysqldump --single-transaction -u ${dbuser} -p"${dbpasswd}" ${db} > ${SAVE_PATH}${dump_file_name}`;
conmand1和command2的运行都会报错,运行结果如下。而使用command3却正常运行
development mysqldump --single-transaction -u root -p‘!Test1234#‘ test_ph0_dev > /var/tmp/backup_20200203110247.dump //打印出的 back_command mysqldump: [Warning] Using a password on the command line interface can be insecure. mysqldump: Got error: 1045: Access denied for user ‘root‘@‘localhost‘ (using password: YES) when trying to connect
直接运行打印出的back_command也能正常运行
[root@localhost log]# mysqldump --single-transaction -u root -p‘!Borg1234#‘ borg_ph0_dev > /var/tmp/backup_20200203110247.dump mysqldump: [Warning] Using a password on the command line interface can be insecure.
不知道这是什么原因,希望有大神能够解答。谢谢!
使用shell做数据库备份的时候,遇到了以下问题,原因未知
标签:dump got back error: err denied dev test 使用
热心网友 时间:2022-04-11 05:51
Profile ydf热心网友 时间:2022-04-11 07:09
请给出db2diag.log追问FUNCTION: DB2 UDB, command line process, clp_send_bpreq, probe:2