Home WebServer PanelDirectAdmin Disable mysql-bin on DirectAdmin

Disable mysql-bin on DirectAdmin

by Thạch Phạm
Published: Last Updated on
A+A-
Reset

In this article, AZDIGI will show you how to disable mysql-bin on DirectAdmin because this is one of the reasons for the rapid increase in server capacity.

Although the DirectAdmin server does not enable mysql-bin by default, it may be that we have accidentally configured it or you have simply optimized the speed of DirectAdmin’s MySQL in the following way, by default the mysql-bin option is enabled.

I. What is MySql Binary Log?

MySql Binary Log is a mechanism of MySql used to store data changes as a log file. All changes will be appended only to a numbered log file. Each change is characterized by two parameters: the log file is written to the offset on the log file. MySql Binary Log has three types:

  • Statement Based: stores statements that change data.
  • Row based: store the changed data.
  • Mixed: stores both statements and changes data of each row.

However, when activating MySql Binary Log will use a lot of the server’s storage space, and this capacity does not stop at all, it will increase over time as long as there are changes to the data in the database.

So we need to disable mysql-bin on DirectAdmin.

II. Disable mysql-bin on DirectAdmin

To disable mysql-bin on DirectAdmin, we follow 3 these steps.

Step 1: SSH into your DirectAdmin system

To disable mysql-bin on DirectAdmin, we first need to SSH or access your VPS/server with root privileges. If you don’t know how to SSH into your VPS/Server, you can refer to the following tutorial:

After successfully SSH, we continue with step 2 to change the MySQL/MariaDB configuration at my.cnf file.

Step 2: Disable mysql-bin on DirectAdmin by editing the configuration

Usually, the my.cnf configuration file will be located at /ect/my.cnf, and we use the following command to edit the configuration:

AZDIGI Tutorial
vi /etc/my.cnf
    

At the content of the file configuration, let’s find the configuration line has log-bin= and disable the whole line by adding a # (hashtag) in front of the line as below. Then save the configuration file.

disable-mysql-bin-on-directadmin
Disable mysql-bin on DirectAdmin.

Note: You must find all log-bin= configurations and disable it, because there are some cases where we may accidentally configure to 2 lines.

Once disabled, let’s restart MySQL/MariaDB with the following command:

AZDIGI Tutorial
service mysqld restart
    

Please wait a moment for the MySQL/MariaDB restarts to complete. We can then delete files named mysql-bin.000001, mysql-bin.000002, mysql-bin.000003, mysql-bin.000004… These filenames will depend on the information behind the configuration log-bin=.

Since my configuration is log-bin=mysql-bin , my files will be mysql-bin.000001 or higher. Usually, this file will be about 1.1GB in size. Below is the command that lists the mysql-bin.0000X files on my system that I need to delete.

AZDIGI Tutorial
du -sh /var/lib/mysql/* | grep mysql-bin.0
    
disable-mysql-bin-on-directadmin
List of log files MySql Binary Log.

Then I will use the following command to delete these MySql Binary Log files to free up disk space:

AZDIGI Tutorial
cd /var/lib/mysql/
rm -f mysql-bin.00*
    

Explanation of the two commands above:

  • Command 1: Move to the mysql folder.
  • Command 2: Force delete files that start with mysql-bin.00.

After I execute the delete command, then recheck with the following command, no results are displayed anymore.

AZDIGI Tutorial
du -sh /var/lib/mysql/* | grep mysql-bin.0
    
disable-mysql-bin-on-directadmin
After deleting, the MySQL Binary Log files are gone and will not be born anymore.

With the above steps, we can disable mysql-bin on DirectAdmin successfully.

III. Summary

Thus, AZDIGI has completed the steps to disable mysql-bin on DirectAdmin. This will help free up a lot of server space when you’ve accidentally left this configuration unnoticed for a long time and also reduce the load since the server doesn’t have to log these logs.

Hope this article will be of help to you. Wishing you success!

See more useful articles about DirectAdmin at the following link:

If you need assistance, you can contact support in the ways below:

  • Hotline 247: 028 888 24768 (Ext 0)
  • Ticket/Email: You use the email to register for the service and send it directly to: support@azdigi.com .
  • Refer to Hosting/VPS service here!
Đánh giá

Tham gia nhóm hỗ trợ Server - Hosting

Tham gia nhóm Hỗ trợ Server - Hosting & WordPress để cùng nhau hỏi đáp và hỗ trợ các vấn đề về WordPress, tối ưu máy chủ/server.

Tham gia ngay

Bài viết cùng chuyên mục

AZDIGI – Không chỉ là đơn vị hàng đầu trong lĩnh vực Web Hosting và Máy chủ, chúng tôi mong muốn mang lại những kiến thức bổ ích nhất và luôn cập nhật thường xuyên cho cộng đồng người đam mê thiết kế website, công nghệ,…

Vui lòng không sao chép nội dung nếu chưa xin phép. Designed and Developed by PenciDesign