So I'm trying to turn my Raspberry pi into an automated MYSQL backup server but I'm struggling to find a working shell script to archive what I'm looking for. Until I came across this Git Repo but when I try to run the script with all the correct credentials I am returned an error

mysqldump: command not found

This is regarding mysqldump -h $HOST --user=$USER --password=$PASS $database > $BACKDIR/$SERVER-mysqlbackup-$database-$DATE.sql on line 149 although I see no reason why this wouldn't work? Possibly someone else can. Except this, no errors are returned and the zip is created with the .sql file included but with no text. Thanks in advance :)

  • 1
    mysqldump is part of the mysql . mariadb client package. Is that installed? – Dirk Aug 17 '18 at 1:52
  • @Dirk Ahhhh no it's not is there anything special to install or just MySQL? – Charlie Simon Aug 17 '18 at 4:05
  • 2
    Depends on Raspbian version. For Stretch mariadb-client and for Jessie mysql-client – Dirk Aug 17 '18 at 6:29
  • @Dirk your a true legend :) <3 – Charlie Simon Aug 17 '18 at 6:53

mysqldump is part of mysql / mariadb client packages. For Raspbian Jessie install package 'mysql-client', for Stretch you need 'mariadb-client'

  • Wouldn't the package depend on the DBMS one has installed, rather than Raspbian release? – Dmitry Grigoryev Aug 20 '18 at 8:56
  • 1
    No. mysql was replaced by mariadb in Stretch. mariadb is pretty much a plug-in replacement for mysql. I think there are actually some mysql meta-packages that will install mariadb – Dirk Aug 20 '18 at 9:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.