Plesk

How to change the innodb_log_file_size value in MySQL/MariaDB 10.5?

Question

How to change the value of innodb_log_file_size in MySQL/MariaDB 10.5?

Answer

 

Changing the innodb_log_file_size value on Linux

 

  1. Connect to a Plesk server via SSH.

  2. Stop the MySQL/MariaDB service. The command will differ depending on an OS and installed MySQL/MariaDB version:

    # systemctl stop mariadb

    # systemctl stop mysql

  3. Open the MySQL/MariaDB configuration file my.cnf in a text editor. In this example, we are using the vi editor:

    • on CentOS/RHEL-based distributions:

      # vi /etc/my.cnf

    • on Debian/Ubuntu-based distributions:

      # vi /etc/mysql/my.cnf

  4. Under the [mysqld] section, change the innodb_log_file_size value according to your needs (the default value is 48M):

    Note: If the innodb_log_file_size directive does not exist in the file, add it manually under the [mysqld] section.

    [mysqld]
    <...>
    innodb_log_file_size=128M
    <...>

  5. Move the redo log files ib_logfile0 and ib_logfile1 to another directory. In this example, the files are moved to /root:

    # mv /var/lib/mysql/ib_log* /root

  6. Start the MySQL service:

    # systemctl start mariadb

    # systemctl start mysql

 

Changing the innodb_log_file_size value on Windows Server

 

In Plesk for Windows, there are two MySQL/MariaDB instances with their own configuration:

  • Plesk SQL server for Plesk system databases (location %plesk_dir%MySQL)
  • MySQL server for customers' databases (location %plesk_dir%DatabasesMySQL)

 

  1. Connect to a Plesk server via RDP.

  2. Open MySQL/MariaDB configuration file my.ini in any text editor (Just paste the below path in Windows Explorer to open):

    • for Plesk SQL server:

      C:> %plesk_dir%MySQLmy.ini

    • for MySQL server:

      C:> %plesk_dir%DatabasesMySQLmy.ini

  3. Under the [mysqld] section, change the innodb_log_file_size value according to your needs (the default value is 10M):

    innodb_log_file_size=128M

  4. Remove the redo log files:

    • for Plesk SQL server:

      Browse to the folder %plesk_dir%MySQLData and delete the files ib_logfile0 and ib_logfile1.

    • for MySQL server:

      Browse to the folder %plesk_dir%DatabasesMySQLdata and delete the files ib_logfile0 and ib_logfile1.

  5. Start the Plesk SQL Server/MySQL57 service via Plesk Services Monitor or Windows Services.

 

Exit mobile version