Skip to content

Creating a MySQL installation for local testing

This article explains how to install MySQL (via MariaDB) locally in a virtual machine for website testing and development.

Important
These instructions assume you already have a virtual machine running AlmaLinux on your computer.

Ruachost servers use MariaDB, a drop-in replacement for MySQL.

For compatibility details, see MariaDB vs MySQL Compatibility.

  1. Start the virtual machine.
  2. Log in as the root user.
  3. Install MariaDB by running:
yum install mariadb-server
  1. At the prompt, type y and press Enter.
  2. Start the MariaDB service:
systemctl start mariadb
  1. Verify that MariaDB is running:
systemctl status mariadb

You should see Active: active (running) in the output.

  1. Enable MariaDB to start automatically on boot:
systemctl enable mariadb
  1. Secure the installation and set the root password:
mysql_secure_installation
  1. Verify that the root password works:
mysql -u root -p

Enter the root password you set. You should see Welcome to the MariaDB monitor.

Tip
After installing MariaDB, you can configure databases, users, and more for local testing.