Select Page

How to Improve the Speed of MariaDB on Windows

How to Improve the Speed of MariaDB Server on Windows PC by Increasing Memory Allocation

Improving the performance of your MariaDB server on a Windows PC can significantly enhance database operations, especially when dealing with large datasets. One effective way to achieve this is by increasing the memory dedicated to the database. This guide will walk you through the steps to locate and edit the my.ini configuration file to allocate more memory to MariaDB.

Step 1: Locate the my.ini Configuration File

  1. Open File Explorer and navigate to the C drive: C:\.
  2. Follow this path: Program Files -> MariaDB -> 10.5 -> Data.
  3. Inside the Data folder, locate the my.ini file.

Step 2: Open my.ini with a Text Editor

  1. Right-click on the my.ini file and select Open with.
  2. Choose a text editor, such as Notepad or Notepad++.

Step 3: Edit the innodb_buffer_pool_size Setting

  1. Inside the my.ini file, look for the [mysqld] section. This section is enclosed in square brackets.
  2. Check if there is a line with the innodb_buffer_pool_size configuration value. It looks something like this:
    innodb_buffer_pool_size=128M
  3. If this line exists, change its value to 8156M to allocate 8GB of memory (if you have at least 12GB of total memory) or more:
    innodb_buffer_pool_size=8156M
  4. If the line does not exist, add the following under the [mysqld] section:
    [mysqld]
    innodb_buffer_pool_size=8156M

Step 4: Save the Changes

  1. After editing the file, save the changes by clicking File -> Save or pressing Ctrl + S.
  2. Close the text editor.

Step 5: Restart the MariaDB Service

  1. Press Ctrl + Shift + Escape to open the Task Manager.
  2. Go to the Services tab.
  3. Look for the MariaDB or MySQL service in the list.
  4. Right-click on the service and select Restart.

Conclusion

By following these steps, you have successfully increased the memory allocation for MariaDB to 8GB. This change allows MariaDB to load more information into memory, providing faster access to frequently used data, such as indexes. This can result in a noticeable improvement in database performance, particularly when working with large databases and running complex queries.

Regularly monitoring and adjusting the memory allocation based on your system’s resources and database usage can help maintain optimal performance.

Documentation