-1

When I used mysqldump command in Jenkinsfile of Gogs (git) to backup my database, I got an error in Jenkins build says that mysqldump not found, even I build first mysql container. Anyone can help ?

Thanks,

Mahmoud

Mahmoud
  • 1
  • 6
  • Welcome to stackoverflow. How are you building the container and what's your pipeline code? Hard to help without any kind of detail – StephenKing Aug 24 '18 at 10:43

1 Answers1

0

Do you have mysql client on your jenkins server?

Maybe when you builded your projec with jenkins it not foud a mysqldump in your jenkins server, then you will need to install the mysql client to use mysqldump, to install mysql client you can use these line:

sudo apt-get install mysql-client-5.1
Brayan Caldera
  • 2,001
  • 2
  • 11
  • 20
  • Sorry Brayan but where should I put exactly because I tried to add it in Jenkinsfile but it didn't work. – Mahmoud Aug 26 '18 at 19:24
  • Your jenkinsfile run it on your jenkins server, you need to install mysql client in your jenkins server and then your jenkinsfile can execute your dump file. – Brayan Caldera Aug 27 '18 at 03:18
  • you won't write the apt-get install in your jenkinsfile, you will need to install the mysql client on your jenkis server – Brayan Caldera Aug 27 '18 at 03:20
  • I did install mysql client in Jenkins server and added mysql-database plugin then tested again, I got the error below : mysqldump: Got error: 2002: "Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2 "No such file or directory")" when trying to connect the input device is not a TTY – Mahmoud Aug 27 '18 at 08:54