How to turn off binary logging in MySQL and MariaDB?

To disable binary logging in MariaDB, you can follow these steps:

Stop the MariaDB server.

systemctl stop mariadb 
# or 
service mariadb stop
# or
service mysqld stop 

Edit the MariaDB configuration file. Use vim or vi command line tool

vi /etc/my.cnf 
# or 
vi /etc/mysql/my.cnf 

The configuration file for MariaDB is typically located in those directories.

Add the following line under [mysqld] directive

skip-log-bin

Note: If you find log-bin under [mysqld] directive, place skip-log-bin after log-bin, or it will not work.
You can disable any options by adding a skip in front of the option.

Restart the MariaDB server.

systemctl start mariadb 
# or 
service mariadb start
# or 
service mysqld start

Verify that binary logging is disabled

SHOW VARIABLES LIKE 'log_bin';

If the value returned is OFF, binary logging is disabled.

Check existing binary files.

SHOW BINARY LOGS;

Delete existing binary files.