> ## Documentation Index
> Fetch the complete documentation index at: https://kb.hosting.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Creating a MySQL installation for local testing

> In this article, learn how to install MySQL locally in a virtual machine for your own website testing and development.

This article describes how to create a MySQL installation that you can use for local testing.

<Warning>
  **Important**

  The following procedures assume that you have already created a virtual machine running AlmaLinux on your local computer. For information about how to do this, please see [this article](/docs/configuring-a-virtual-machine-for-local-testing).
</Warning>

## Installing MySQL

Hosting.com servers actually use [MariaDB](https://mariadb.org/), an enhanced drop-in replacement for MySQL.

<Note>
  For detailed information about compatibility between MariaDB and MySQL, please visit [https://mariadb.com/kb/en/library/mariadb-vs-mysql-compatibility](https://mariadb.com/kb/en/library/mariadb-vs-mysql-compatibility).
</Note>

To install MariaDB on your virtual machine, follow these steps:

1. Start the virtual machine, if you haven't already.

2. Log in to the virtual machine as the root user.

3. At the command prompt, type the following command to install MariaDB:

   ```bash theme={null}
   yum install mariadb-server
   ```

4. At the **Is this ok** prompt, type `y` and then press Enter. The installation process begins.

5. After installation completes, type the following command to start MariaDB:

   ```bash theme={null}
   systemctl start mariadb
   ```

6. To confirm MariaDB is running, type the following command:

   ```bash theme={null}
   systemctl status mariadb
   ```

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

7. To make MariaDB start automatically on system boot, type the following command:

   ```bash theme={null}
   systemctl enable mariadb
   ```

8. To secure the installation, type the following command:

   ```bash theme={null}
   mysql_secure_installation
   ```

   This program enables you to set the root MySQL password and other security-related settings.

9. To make sure the root password was set correctly, type the following command:

   ```bash theme={null}
   mysql -u root -p
   ```

10. Type the root password that you set in step 8, and then press Enter. You should see **Welcome to the MariaDB monitor** in the output.

<Tip>
  Now that you have installed MariaDB, you are ready to configure it. For information about how to set up MySQL databases, users, and more, please see the **Related Articles** section below.
</Tip>

## Related articles

* [Connecting to MySQL from the command line](/docs/connect-to-mysql-from-the-command-line)

* [Managing MySQL databases, users, and tables from the command line](/docs/managing-mysql-databases-and-users-from-the-command-line)

* [Importing and exporting a MySQL database](/docs/import-and-export-a-mysql-database)

* [Checking MySQL database and table sizes](/docs/determining-the-size-of-mysql-databases-and-tables)

* [Configuring a virtual machine for local testing](/docs/configuring-a-virtual-machine-for-local-testing)
