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.

Installing MySQL (MariaDB)

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

For compatibility details, see MariaDB vs MySQL Compatibility.

Steps to Install MariaDB:

  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.

Was this answer helpful? 0 Users Found This Useful (0 Votes)

Powered by WHMCompleteSolution