Ad Widget

Collapse

Why mysql database dont reduce after "clean history selected items"?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • chico
    Junior Member
    • Jan 2009
    • 2

    #1

    Why mysql database dont reduce after "clean history selected items"?

    Hi,
    Why mysql database is very large:about 120G, I "clean history selected items" in Configuration-Items, but the database size donot reduce.
    What should I do now? I am new to zabbix and mysql.
    Thanks!
  • nelsonab
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Sep 2006
    • 1233

    #2
    With Innodb as your storage engine for MySQL you will not see the DB files shrink when you clean up the DB. If you however check the DB itself you will see additional space within the DB itself from the space you recently cleared up.

    If you wish to physically shrink the DB files themselves you need to perform a mysqldump, erase files, sql import. Do some google searches on resisizing innodb first before proceeding, as you cannot undo this without a good backup, and knowledge of what you are doing.

    Hope this helps get you started on your journey.
    RHCE, author of zbxapi
    Ansible, the missing piece (Zabconf 2017): https://www.youtube.com/watch?v=R5T9NidjjDE
    Zabbix and SNMP on Linux (Zabconf 2015): https://www.youtube.com/watch?v=98PEHpLFVHM

    Comment

    • chico
      Junior Member
      • Jan 2009
      • 2

      #3
      Thanks a lot!

      Comment

      • xs-
        Senior Member
        Zabbix Certified Specialist
        • Dec 2007
        • 393

        #4
        You probably want the option innodb_file_per_table. Requires and dump/restore of the entire db instance tho, but then the data files are shrinkable.

        Comment

        Working...