skip to Main Content

I like to make cron that will dump specific table from database for some reason im getting empty file in .gz any ideas why ?

mysqldump -u root -pp;qqee test_db category | gzip >/home/user/BKP-Category/backup_$( date +"%Y_%m_%d" ).sql.gz

im getting this output after execution

    Usage: mysqldump [OPTIONS] database [tables]
    OR     mysqldump [OPTIONS] --databases DB1 [DB2 DB3...]
    OR     mysqldump [OPTIONS] --all-databases
    OR     mysqldump [OPTIONS] --system=[SYSTEMOPTIONS]]
    For more options, use mysqldump --help
    /usr/local/cpanel/bin/jailshell: q: command not found

2

Answers


  1. Chosen as BEST ANSWER

    the problem was password

    -pp;qqee

    because include special character ;

    i should escape this like

    -p'p;qqee'


  2. This should work :

    mysqldump -u root -p 'p;qqee' test_db category | gzip >/home/user/BKP-Category/backup_$( date +"%Y_%m_%d" ).sql.gz
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search