我正在尝试使用 mysqldump,但在尝试连接时收到错误 mysqldump: Got error: 2003: Can't connect to MySQL server on host(110)

我正在尝试使用 mysqldump,但在尝试连接时收到错误 mysqldump: Got error: 2003: Can't connect to MySQL server on host(110)

下面是用于采取数据库备份触发器的 sam 模板:

- none  
  
pool:  
  vmImage: ubuntu-latest  
  
steps:  
- script: echo Hello, world!  
  displayName: 'Run a one-line script'  

- script: |
    sudo apt-get -f install -o Dpkg::Options::="--force-overwrite"
    sudo apt-get update
    sudo apt-get purge mysql\*
    rm -rf /var/lib/mysql
    rm -rf /etc/mysql
    dpkg -l | grep -i mysql
    sudo apt-get clean
    updatedb
    sudo apt-get install mysql-client
  displayName: 'Getting Mysql Client'
- script: |
    mysql -V
  displayName: 'Displaying Mysql Client version'
- script: |
    mysqldump -h host --triggers --routines -u username --password="password" -P 3306 SDA_RMA_DE > dev_sda_db_bkp_test.sql
  displayName: 'Taking Backup'

当我尝试运行管道时,执行备份步骤 mysqldump 失败:

Got error: 2003: Can't connect to MySQL server on 'host' (110) when trying to connect

请帮我告诉我如何克服这个错误

相关内容