Install MariaDB on Ubuntu Print

  • 0

Introduction

This Quickstart guide explains how to install MariaDB on a Rcs Ubuntu cloud server. The guide applies to Ubuntu 16.04 through Ubuntu 20.10 LTS. MariaDB is a drop-in replacement for MySQL.

1. Deploy Ubuntu Server

Change to your sudo user for the remaining steps.

2. Install MariaDB

  1. Install MariaDB, a drop-in replacement for MySQL.

     $ sudo apt install mariadb-server mariadb-client -y
  2. Enable MariaDB to start on boot.

     $ sudo systemctl enable mariadb.service
  3. Secure the database. Answer all the security questions as shown.

     $ sudo mysql_secure_installation

    * Initially, there is no password for root. Press Enter.

         Enter current password for root (enter for none):

    * Press Enter to enter a new password.

         Set root password? [Y/n]

    * Enter and confirm a root password for MariaDB.

         New password:
         Re-enter new password:
         Password updated successfully!

    * Press Enter to remove the anonymous user.

         Remove anonymous users? [Y/n]

    * Press Enter to disallow remote root logins.

         Disallow root login remotely? [Y/n]

    * Press Enter to remove the test database.

         Remove test database and access to it? [Y/n]

    * Press Enter to reload the privilege tables.

         Reload privilege tables now? [Y/n]

    This completes the basic security configuration.

3. Test

  1. Connect to the database as root.

     # mysql -u root -p -h localhost
  2. Create a test user.

     > CREATE USER 'test_user'@'localhost' IDENTIFIED BY 'test_pass';
  3. Create a test database.

     > CREATE DATABASE test_database;
  4. Grant the test user privileges on the test database.

     > GRANT ALL PRIVILEGES ON test_database.* TO 'test_user'@'localhost';
  5. Exit the database client.

     > quit

Conclusion

You have successfully installed MariaDB on a Rcs Ubuntu cloud server. For more information, see the official MariaDB documentation.

Introduction This Quickstart guide explains how to install MariaDB on a Rcs Ubuntu cloud server. The guide applies to Ubuntu 16.04 through Ubuntu 20.10 LTS. MariaDB is a drop-in replacement for MySQL. 1. Deploy Ubuntu Server Deploy a new Ubuntu Rcs cloud server instance. Follow our best practices guides: Create a sudo user. Update the Ubuntu server. Change to your sudo user for the remaining steps. 2. Install MariaDB Install MariaDB, a drop-in replacement for MySQL. $ sudo apt install mariadb-server mariadb-client -y Enable MariaDB to start on boot. $ sudo systemctl enable mariadb.service Secure the database. Answer all the security questions as shown. $ sudo mysql_secure_installation * Initially, there is no password for root. Press ENTER. Enter current password for root (enter for none): * Press ENTER to enter a new password. Set root password? [Y/n] * Enter and confirm a root password for MariaDB. New password: Re-enter new password: Password updated successfully! * Press ENTER to remove the anonymous user. Remove anonymous users? [Y/n] * Press ENTER to disallow remote root logins. Disallow root login remotely? [Y/n] * Press ENTER to remove the test database. Remove test database and access to it? [Y/n] * Press ENTER to reload the privilege tables. Reload privilege tables now? [Y/n] This completes the basic security configuration. 3. Test Connect to the database as root. # mysql -u root -p -h localhost Create a test user. > CREATE USER 'test_user'@'localhost' IDENTIFIED BY 'test_pass'; Create a test database. > CREATE DATABASE test_database; Grant the test user privileges on the test database. > GRANT ALL PRIVILEGES ON test_database.* TO 'test_user'@'localhost'; Exit the database client. > quit Conclusion You have successfully installed MariaDB on a Rcs Ubuntu cloud server. For more information, see the official MariaDB documentation.

Was this answer helpful?
Back

Powered by WHMCompleteSolution