0

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 :)

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

1 Answer 1

4

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

2
  • Wouldn't the package depend on the DBMS one has installed, rather than Raspbian release? Commented Aug 20, 2018 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
    Commented Aug 20, 2018 at 9:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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