How to Install MariaDB 11.0 on Ubuntu

A decade after the previous release, the highly anticipated MariaDB Server 11.0 has finally arrived, boasting a wealth of improvements and new features. Among the most notable advancements is the introduction of a new optimizer cost model, which aims to enhance the accuracy of predicting query execution plan costs. This feature is a direct response to the MariaDB community’s reports of performance issues stemming from suboptimal query plans.

Key Features and Enhancements of MariaDB 11.0

  • New Optimizer Cost Model: The flagship feature of MariaDB 11.0 aims to more accurately predict the cost of each query execution plan. While this improvement will not guarantee better performance in all scenarios, it serves as a significant signal of the ongoing enhancements in MariaDB’s major version releases.
  • Storage Engine Operation Costs: The basic cost for “storage engine operations” has been changed to one millisecond, bringing the cost closer to the actual server time spent in storage engine, join_cache, and sorting operations.
  • Improved Cost Accuracy: By breaking down engine costs into smaller components and assuming a default SSD disk speed of 400/second (modifiable via the OPTIMIZER_DISK_READ_COST variable), MariaDB 11.0 delivers a more accurate assessment of disk read costs.
  • InnoDB Change Buffer Removal: MariaDB 11.0 has removed the InnoDB change buffer (MDEV-29694), streamlining the storage engine further.
  • New and Updated Variables: MariaDB 11.0 features a host of new system and status variables, as well as updated default values and deprecated variables. For a comprehensive list, refer to the MariaDB documentation.
  • Enhanced Sorting Costs: With more accurate sorting costs, the optimizer can now better choose between index scans and filesorts for ORDER BY/GROUP BY queries.
  • Optimized Query Plans: The new optimizer changes are particularly beneficial for scenarios involving multi-table queries, indexes with many identical values, large range queries, complex queries with unindexed columns, mixed storage engine queries, and more.

By addressing the concerns raised by the MariaDB community and making substantial improvements to the optimizer, MariaDB 11.0 has taken a major step forward in optimizing database performance. The guide that follows will demonstrate how to install MariaDB 11.0 on Ubuntu 22.04 Jammy Jellyfish and Ubuntu 20.04 Focal Fossa using MariaDB’s official repository mirror for the latest secure version of this release.

Step 1: Pre-installations Steps

Update Ubuntu

To ensure a smooth installation, it’s essential to update your system so that all existing packages are up-to-date. Open your terminal and run the following command:

sudo apt update

Once you’re ready, proceed to upgrade any outdated packages with the following command:

sudo apt upgrade

Install Packages

Before installing MariaDB, you’ll need to install some dependencies. Enter the following command in your terminal:

sudo apt install dirmngr ca-certificates software-properties-common apt-transport-https curl -y

Step 2: Incorporate MariaDB.org Repository

To ensure a seamless installation, we must first import the GPG key that verifies the MariaDB packages. Execute the command below to achieve this:

curl -fsSL http://mirror.mariadb.org/PublicKey_v2 | sudo gpg --dearmor | sudo tee /usr/share/keyrings/mariadb.gpg > /dev/null

With the GPG key in place, proceed to import the MariaDB repository. The following command is compatible with both 22.04 and 20.04 LTS releases:

echo "deb [arch=amd64,arm64,ppc64el signed-by=/usr/share/keyrings/mariadb.gpg] http://mirror.mariadb.org/repo/11.0/ubuntu/ $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/mariadb.list

Lastly, perform an APT update to synchronize your system with the newly imported repository:

sudo apt update

Step 3: Install MariaDB 11.0 on Ubuntu

To successfully set up MariaDB 11.0 on your system, you must install both the client and server packages. Execute the following command to achieve this:

sudo apt install mariadb-server mariadb-client

After the installation is complete, you can verify the installation by checking the MariaDB version and build with this command:

mariadb --version

In case you have a previous version of MariaDB installed, the installation process typically upgrades the databases. However, there might be issues with Content Management Systems (CMS) like WordPress, where the upgrade isn’t fully executed. To ensure your database is upgraded correctly, run the following command:

sudo mysql_upgrade

Using the sudo mysql_upgrade command, the system initiates the process of upgrading your MariaDB database. This command examines all tables within the specified databases and performs repairs if required.

Conclusion

In conclusion, installing MariaDB 11.0 on Ubuntu requires careful planning and execution, but the benefits of having a powerful and reliable database system can greatly outweigh the effort involved. By following best practices and utilizing available resources, one can achieve a professional and optimized installation of MariaDB on Ubuntu.

Additional Resources and Links

If you are looking for additional resources to help you install and optimize MariaDB 11.0 on Ubuntu, the following links may be useful:

  • MariaDB 11.0 Release Notes: https://mariadb.com/kb/en/mariadb-11-0-0-release-notes/ The MariaDB 11.0 Release Notes provide a comprehensive overview of the new features and improvements in MariaDB 11.0, as well as information on known issues and upgrade considerations.
  • MariaDB Knowledge Base: https://mariadb.com/kb/ The MariaDB Knowledge Base is a valuable resource for troubleshooting and optimizing your database system. It contains a wealth of articles and tutorials on topics such as database design, performance tuning, and security best practices.

Share to...