Score:0

I m trying to use mysqldump but getting error mysqldump: Got error: 2003: Can't connect to MySQL server on host(110) when trying to connect

uz flag

Here is my sam template for taking database backup trigger:

- 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'

When I try running pipeline it got failed in taking backup step mysqldump:

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

Please help me by saying how to overcome this error

Nikita Kipriyanov avatar
za flag
Do you have a *working* way to connect to mysql on this server? E.g. which application does that and how it is configured?
digijay avatar
mx flag
`-h host` seems to be wrong. Did you mean `-h localhost`?
vithya m avatar
uz flag
No I have given main host only but I didnt mentioned here
vithya m avatar
uz flag
@NikitaKipriyanov Sorry I m very to this templates can you please provide some examples like how it needs to be done
vithya m avatar
uz flag
@NikitaKipriyanov Now maually we are taking backup through ec2 instance only, need to mention that connection here or any other way there please help us we are trying to make it automate through pipeline the above mentioned template is for automating db backup and if you have ay idea on this please let me know
Nikita Kipriyanov avatar
za flag
You didn't answered to my question at all. Forget about automation until later. Do you have any means to make a working connection to this database server? From the target application, from `mysql` console client? Which options that connection uses?
vithya m avatar
uz flag
In Ec2 instance only connection establishes
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.