{"id":3236,"date":"2026-04-01T08:04:12","date_gmt":"2026-04-01T08:04:12","guid":{"rendered":"https:\/\/pheonixsolutions.com\/knowledge-base\/?p=3236"},"modified":"2026-04-01T08:04:16","modified_gmt":"2026-04-01T08:04:16","slug":"how-to-reduce-mysql-binary-logs-disk-usage-on-a-cpanel-server","status":"publish","type":"post","link":"https:\/\/pheonixsolutions.com\/knowledge-base\/2026\/04\/01\/how-to-reduce-mysql-binary-logs-disk-usage-on-a-cpanel-server\/","title":{"rendered":"How to Reduce MySQL Binary Logs Disk Usage on a cPanel Server"},"content":{"rendered":"\n<p><strong>Introduction<\/strong>:<br>This guide explains how to reduce disk usage caused by mysql-bin log files in \/var\/lib\/mysql.<\/p>\n\n\n\n<p>Binary logs store database changes and can grow quickly on active servers, filling disk space.<br>By configuring log expiration, old logs will be automatically removed.<\/p>\n\n\n\n<p><strong>Prerequisites<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Root or sudo access<\/li>\n\n\n\n<li>SSH access to the server<\/li>\n\n\n\n<li>MySQL\/MariaDB running<\/li>\n<\/ul>\n\n\n\n<p><strong>Step 1:<\/strong><br>Log in to the server or access the terminal via WHM.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td>$ ssh root@your-server-ip<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><strong><strong>Step 2:<\/strong><\/strong><br>Open the MySQL configuration file and edit it.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td>$ vi \/etc\/my.cnf<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Add the following line under the [mysqld] section:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td>binlog_expire_logs_seconds = 86400<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><strong>Explanation<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>86400<\/code> = 1 day<\/li>\n\n\n\n<li>This means logs older than <strong>1 day will be automatically deleted<\/strong><\/li>\n<\/ul>\n\n\n\n<p>You can adjust as needed:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>604800 \u2192 7 days<\/li>\n\n\n\n<li>2592000 \u2192 30 days<\/li>\n<\/ul>\n\n\n\n<p><strong>Step 3:<\/strong><br>Restart the MySQL service.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td>$ systemctl restart mysqld<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><strong>Conclusion<\/strong><br>By applying this configuration:<br>         1. Old mysql-bin files will be automatically removed<br>         2. Disk usage will be controlled<br>         3. Future disk space issues will be prevented<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction:This guide explains how to reduce disk usage caused by mysql-bin log files in \/var\/lib\/mysql. Binary logs store database changes and can grow quickly on active servers, filling disk space.By configuring log expiration, old logs will be automatically removed. Prerequisites: Step 1:Log in to the server or access the terminal via WHM. $ ssh root@your-server-ip ..<\/p>\n<div class=\"clear-fix\"><\/div>\n<p><a href=\"https:\/\/pheonixsolutions.com\/knowledge-base\/2026\/04\/01\/how-to-reduce-mysql-binary-logs-disk-usage-on-a-cpanel-server\/\" title=\"read more...\">Read more<\/a><\/p>\n","protected":false},"author":9,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-3236","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Reduce MySQL Binary Logs Disk Usage on a cPanel Server - PheonixSolutions Knowledge-Base<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/pheonixsolutions.com\/knowledge-base\/2026\/04\/01\/how-to-reduce-mysql-binary-logs-disk-usage-on-a-cpanel-server\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Reduce MySQL Binary Logs Disk Usage on a cPanel Server - PheonixSolutions Knowledge-Base\" \/>\n<meta property=\"og:description\" content=\"Introduction:This guide explains how to reduce disk usage caused by mysql-bin log files in \/var\/lib\/mysql. Binary logs store database changes and can grow quickly on active servers, filling disk space.By configuring log expiration, old logs will be automatically removed. Prerequisites: Step 1:Log in to the server or access the terminal via WHM. $ ssh root@your-server-ip ..Read more\" \/>\n<meta property=\"og:url\" content=\"https:\/\/pheonixsolutions.com\/knowledge-base\/2026\/04\/01\/how-to-reduce-mysql-binary-logs-disk-usage-on-a-cpanel-server\/\" \/>\n<meta property=\"og:site_name\" content=\"PheonixSolutions Knowledge-Base\" \/>\n<meta property=\"article:published_time\" content=\"2026-04-01T08:04:12+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-04-01T08:04:16+00:00\" \/>\n<meta name=\"author\" content=\"ragupathi N\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"ragupathi N\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/knowledge-base\\\/2026\\\/04\\\/01\\\/how-to-reduce-mysql-binary-logs-disk-usage-on-a-cpanel-server\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/knowledge-base\\\/2026\\\/04\\\/01\\\/how-to-reduce-mysql-binary-logs-disk-usage-on-a-cpanel-server\\\/\"},\"author\":{\"name\":\"ragupathi N\",\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/knowledge-base\\\/#\\\/schema\\\/person\\\/f9ab652ef7b8085385dd36f2e2eddccb\"},\"headline\":\"How to Reduce MySQL Binary Logs Disk Usage on a cPanel Server\",\"datePublished\":\"2026-04-01T08:04:12+00:00\",\"dateModified\":\"2026-04-01T08:04:16+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/knowledge-base\\\/2026\\\/04\\\/01\\\/how-to-reduce-mysql-binary-logs-disk-usage-on-a-cpanel-server\\\/\"},\"wordCount\":159,\"commentCount\":0,\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/pheonixsolutions.com\\\/knowledge-base\\\/2026\\\/04\\\/01\\\/how-to-reduce-mysql-binary-logs-disk-usage-on-a-cpanel-server\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/knowledge-base\\\/2026\\\/04\\\/01\\\/how-to-reduce-mysql-binary-logs-disk-usage-on-a-cpanel-server\\\/\",\"url\":\"https:\\\/\\\/pheonixsolutions.com\\\/knowledge-base\\\/2026\\\/04\\\/01\\\/how-to-reduce-mysql-binary-logs-disk-usage-on-a-cpanel-server\\\/\",\"name\":\"How to Reduce MySQL Binary Logs Disk Usage on a cPanel Server - PheonixSolutions Knowledge-Base\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/knowledge-base\\\/#website\"},\"datePublished\":\"2026-04-01T08:04:12+00:00\",\"dateModified\":\"2026-04-01T08:04:16+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/knowledge-base\\\/#\\\/schema\\\/person\\\/f9ab652ef7b8085385dd36f2e2eddccb\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/knowledge-base\\\/2026\\\/04\\\/01\\\/how-to-reduce-mysql-binary-logs-disk-usage-on-a-cpanel-server\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/pheonixsolutions.com\\\/knowledge-base\\\/2026\\\/04\\\/01\\\/how-to-reduce-mysql-binary-logs-disk-usage-on-a-cpanel-server\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/knowledge-base\\\/2026\\\/04\\\/01\\\/how-to-reduce-mysql-binary-logs-disk-usage-on-a-cpanel-server\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/pheonixsolutions.com\\\/knowledge-base\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Reduce MySQL Binary Logs Disk Usage on a cPanel Server\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/knowledge-base\\\/#website\",\"url\":\"https:\\\/\\\/pheonixsolutions.com\\\/knowledge-base\\\/\",\"name\":\"PheonixSolutions Knowledge-Base\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/pheonixsolutions.com\\\/knowledge-base\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/knowledge-base\\\/#\\\/schema\\\/person\\\/f9ab652ef7b8085385dd36f2e2eddccb\",\"name\":\"ragupathi N\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/7a25050762812aa4121dc2fc399845811de371369904acb2bb9cea2ebc2ed8e0?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/7a25050762812aa4121dc2fc399845811de371369904acb2bb9cea2ebc2ed8e0?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/7a25050762812aa4121dc2fc399845811de371369904acb2bb9cea2ebc2ed8e0?s=96&d=mm&r=g\",\"caption\":\"ragupathi N\"},\"url\":\"https:\\\/\\\/pheonixsolutions.com\\\/knowledge-base\\\/author\\\/ragupathi\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Reduce MySQL Binary Logs Disk Usage on a cPanel Server - PheonixSolutions Knowledge-Base","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/pheonixsolutions.com\/knowledge-base\/2026\/04\/01\/how-to-reduce-mysql-binary-logs-disk-usage-on-a-cpanel-server\/","og_locale":"en_US","og_type":"article","og_title":"How to Reduce MySQL Binary Logs Disk Usage on a cPanel Server - PheonixSolutions Knowledge-Base","og_description":"Introduction:This guide explains how to reduce disk usage caused by mysql-bin log files in \/var\/lib\/mysql. Binary logs store database changes and can grow quickly on active servers, filling disk space.By configuring log expiration, old logs will be automatically removed. Prerequisites: Step 1:Log in to the server or access the terminal via WHM. $ ssh root@your-server-ip ..Read more","og_url":"https:\/\/pheonixsolutions.com\/knowledge-base\/2026\/04\/01\/how-to-reduce-mysql-binary-logs-disk-usage-on-a-cpanel-server\/","og_site_name":"PheonixSolutions Knowledge-Base","article_published_time":"2026-04-01T08:04:12+00:00","article_modified_time":"2026-04-01T08:04:16+00:00","author":"ragupathi N","twitter_card":"summary_large_image","twitter_misc":{"Written by":"ragupathi N","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/pheonixsolutions.com\/knowledge-base\/2026\/04\/01\/how-to-reduce-mysql-binary-logs-disk-usage-on-a-cpanel-server\/#article","isPartOf":{"@id":"https:\/\/pheonixsolutions.com\/knowledge-base\/2026\/04\/01\/how-to-reduce-mysql-binary-logs-disk-usage-on-a-cpanel-server\/"},"author":{"name":"ragupathi N","@id":"https:\/\/pheonixsolutions.com\/knowledge-base\/#\/schema\/person\/f9ab652ef7b8085385dd36f2e2eddccb"},"headline":"How to Reduce MySQL Binary Logs Disk Usage on a cPanel Server","datePublished":"2026-04-01T08:04:12+00:00","dateModified":"2026-04-01T08:04:16+00:00","mainEntityOfPage":{"@id":"https:\/\/pheonixsolutions.com\/knowledge-base\/2026\/04\/01\/how-to-reduce-mysql-binary-logs-disk-usage-on-a-cpanel-server\/"},"wordCount":159,"commentCount":0,"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/pheonixsolutions.com\/knowledge-base\/2026\/04\/01\/how-to-reduce-mysql-binary-logs-disk-usage-on-a-cpanel-server\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/pheonixsolutions.com\/knowledge-base\/2026\/04\/01\/how-to-reduce-mysql-binary-logs-disk-usage-on-a-cpanel-server\/","url":"https:\/\/pheonixsolutions.com\/knowledge-base\/2026\/04\/01\/how-to-reduce-mysql-binary-logs-disk-usage-on-a-cpanel-server\/","name":"How to Reduce MySQL Binary Logs Disk Usage on a cPanel Server - PheonixSolutions Knowledge-Base","isPartOf":{"@id":"https:\/\/pheonixsolutions.com\/knowledge-base\/#website"},"datePublished":"2026-04-01T08:04:12+00:00","dateModified":"2026-04-01T08:04:16+00:00","author":{"@id":"https:\/\/pheonixsolutions.com\/knowledge-base\/#\/schema\/person\/f9ab652ef7b8085385dd36f2e2eddccb"},"breadcrumb":{"@id":"https:\/\/pheonixsolutions.com\/knowledge-base\/2026\/04\/01\/how-to-reduce-mysql-binary-logs-disk-usage-on-a-cpanel-server\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/pheonixsolutions.com\/knowledge-base\/2026\/04\/01\/how-to-reduce-mysql-binary-logs-disk-usage-on-a-cpanel-server\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/pheonixsolutions.com\/knowledge-base\/2026\/04\/01\/how-to-reduce-mysql-binary-logs-disk-usage-on-a-cpanel-server\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/pheonixsolutions.com\/knowledge-base\/"},{"@type":"ListItem","position":2,"name":"How to Reduce MySQL Binary Logs Disk Usage on a cPanel Server"}]},{"@type":"WebSite","@id":"https:\/\/pheonixsolutions.com\/knowledge-base\/#website","url":"https:\/\/pheonixsolutions.com\/knowledge-base\/","name":"PheonixSolutions Knowledge-Base","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/pheonixsolutions.com\/knowledge-base\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/pheonixsolutions.com\/knowledge-base\/#\/schema\/person\/f9ab652ef7b8085385dd36f2e2eddccb","name":"ragupathi N","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/7a25050762812aa4121dc2fc399845811de371369904acb2bb9cea2ebc2ed8e0?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/7a25050762812aa4121dc2fc399845811de371369904acb2bb9cea2ebc2ed8e0?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/7a25050762812aa4121dc2fc399845811de371369904acb2bb9cea2ebc2ed8e0?s=96&d=mm&r=g","caption":"ragupathi N"},"url":"https:\/\/pheonixsolutions.com\/knowledge-base\/author\/ragupathi\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/pheonixsolutions.com\/knowledge-base\/wp-json\/wp\/v2\/posts\/3236","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pheonixsolutions.com\/knowledge-base\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pheonixsolutions.com\/knowledge-base\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/knowledge-base\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/knowledge-base\/wp-json\/wp\/v2\/comments?post=3236"}],"version-history":[{"count":2,"href":"https:\/\/pheonixsolutions.com\/knowledge-base\/wp-json\/wp\/v2\/posts\/3236\/revisions"}],"predecessor-version":[{"id":3238,"href":"https:\/\/pheonixsolutions.com\/knowledge-base\/wp-json\/wp\/v2\/posts\/3236\/revisions\/3238"}],"wp:attachment":[{"href":"https:\/\/pheonixsolutions.com\/knowledge-base\/wp-json\/wp\/v2\/media?parent=3236"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/knowledge-base\/wp-json\/wp\/v2\/categories?post=3236"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/knowledge-base\/wp-json\/wp\/v2\/tags?post=3236"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}