Categories: Linux

How to enable Large Indexes in MariaDB 10 on Debian 10

This tutorial shows you how to enable large indexes in MariaDB 10 on Debian 10. This refers to the innodb_large_prefix option which exists in MariaDB and MySQL. I will show you how to enable the large index option permanently by editing the MariaDB configuration file and I will also show you how to enable it temporarily in the current database session by using SQL commands. InnoDB large prefix allows it to have index key prefixes up to 3072 bytes (for 16k pages, smaller otherwise).

Enable InnoDB Large Indexes in MariaDB using the config file

Edit the MariaDB server configuration file:

nano /etc/mysql/mariadb.conf.d/50-server

And place the following lines right after the [mysqld] line:

innodb-file-format=barracuda
innodb-file-per-table=ON
innodb-large-prefix=ON
innodb_default_row_format = 'DYNAMIC'

Close the editor. Then restart MariaDB:

systemctl restart mariadb.service

Enable Large Indexes in MariaDB using SQL commands

These commands are an alternative approach to the config editing option, so don't use both methods. Open a MariaDB database connection for the root user on the console:

mysql -u root -p

Then run the following commands:

SET GLOBAL innodb_file_format=Barracuda;
SET GLOBAL innodb_file_per_table=ON;
SET GLOBAL innodb_large_prefix=1;
Quit

Then log in again and run:

SET GLOBAL innodb_default_row_format=DYNAMIC;

The large index prefix option is enabled in your MariaDB system now.

Till Brehm

Recent Posts

How to Install Magento 2 on AlmaLinux

Magento is a free and open-source e-commerce platform written in PHP. It is simple, easy…

1 year ago

How to Install ISPConfig Hosting Control Panel with Apache Web Server on Ubuntu 24.04

ISPConfig is an open-source control panel that allows users to manage multiple servers from a…

1 year ago

How to Test your Email Server (SMTP) Using the Telnet Command

As a Linux administrator, you may find it necessary to troubleshoot or test your Simple…

1 year ago

Managing Network Interfaces and Settings on Ubuntu 24.04 with nmcli

Ubuntu 24.04, like many modern Linux distributions, relies on the NetworkManager for managing network connections.…

2 years ago

Using Restic Backup on Ubuntu 24.04

Restic is a modern, open-source backup program designed for efficiency, security, and simplicity. It enables…

2 years ago

Installing phpMyAdmin on Rocky Linux 9 and Securing it with Let’s Encrypt SSL

phpMyAdmin is a popular free tool written in PHP intended to administer MySQL and MariaDB…

2 years ago