Ad Widget

Collapse

Trying to upgrade, failing to dump old 4.4 db

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Maxburn
    Member
    • Sep 2019
    • 48

    #1

    Trying to upgrade, failing to dump old 4.4 db

    I'm using the 4.4 appliance and I want to move to a new VM for 5.x. I'm following this guide; https://gist.github.com/mwalczak/9807459

    EDIT; -p parameter is DB to dump, not the password. Further notablespace appears to be required now for the process error
    Code:
    mysqldump -u zabbix -p zabbix --no-tablespaces > ~/backups/zabbix-$(date +%F).sql
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    First off my DB appears to be 3.2G
    Code:
    sudo du -shc /var/lib/mysql/zabbix
    3.2G /var/lib/mysql/zabbix
    3.2G total
    I had been running this command to backup the DB I found on another guide
    Code:
    mysqldump --all-databases --single-transaction --quick --lock-tables=false > ~/backups/full-backup-$(date +%F).sql -u zabbix -p password
    Unfortunately that looks like it doesn't work as it completes instantly and the file it puts out is way too small
    Code:
    ~/backups$ ls -l
    total 8
    -rw-rw-r-- 1 appliance appliance 203 Aug 13 09:02 full-backup-2020-08-13.sql
    Going by the command in that guide appears to have syntax problems because it's trying to dump a database by the name of my zabbix password. Maybe I don't know what account password it is asking for because it throws an error on that too
    Code:
    mysqldump -u zabbix -p password > /tmp/zabbix_db_dump
    Enter password:
    mysqldump: Error: 'Access denied; you need (at least one of) the PROCESS privilege(s) for this operation' when trying to dump tablespaces
    mysqldump: Got error: 1044: Access denied for user 'zabbix'@'localhost' to database 'password' when selecting the database
    Last thing I tried was this
    Code:
    appliance@zabbix:~/backups$ mysqldump --all-databases > ~/backups/full-backup-$(date +%F).sql -u zabbix -p password
    appliance@zabbix:~/backups$ ls -l
    total 4
    -rw-rw-r-- 1 appliance appliance 203 Aug 13 09:29 full-backup-2020-08-13.sql
    appliance@zabbix:~$ du -shc backups
    8.0K backups
    8.0K total
    What the heck do I actually have to do to get a db dump of this thing?




    Last edited by Maxburn; 13-08-2020, 19:13.
  • tim.mooney
    Senior Member
    • Dec 2012
    • 1427

    #2
    Originally posted by Maxburn
    Code:
    mysqldump --all-databases --single-transaction --quick --lock-tables=false > ~/backups/full-backup-$(date +%F).sql -u zabbix -p password
    What the heck do I actually have to do to get a db dump of this thing?
    Reading the man page for mysqldump and paying attention to the comments about the '-p' option might help:

    Code:
     o --password[=password], -p[password]
    
    The password to use when connecting to the server. If you use the
    short option form (-p), you cannot have a space between the option
    and the password. If you omit the password value following the
    --password or -p option on the command line, mysqldump prompts for
    one.
    
    Specifying a password on the command line should be considered
    insecure. You can use an option file to avoid giving the password
    on the command line.
    In addition, the 'zabbix' database user probably doesn't have permission to correctly dump "--all-database", so you probably either want to use the mysql "root" user or you want to only dump the 'zabbix' database from the appliance.

    While Linux shells will allow the redirection (> /backups/full-backup-<stuff>) to happen in the middle of the line like you've shown, it's more portable if you move it to the end of the line.

    Comment

    • Maxburn
      Member
      • Sep 2019
      • 48

      #3
      Thank you, yes I got it. There is a edit at the top of OP regarding what worked.

      Comment

      Working...