How to Setup MariaDB Ubuntu Cloud in Azure/AWS/GCP

To install and setup MariaDB on Ubuntu and run on any of the cloud platforms (Azure, AWS or Google GCP), the best way is to use the readily available images in the marketplaces. Deploy with the latest version of MariaDB on Ubuntu. Check the links below to deploy straight into your environment.

Cloud MariaDB

Table of Contents

MariaDB Database Management System (DBMS) features

MariaDB is a popular fork of MySQL , multi-threaded, relational database management system and some of the features it offers are:

 

  • Offers a wide selection of storage engines and for other RDBMS data sources.
  • MariaDB operates in PHP, one of the most popular web development languages.
  • Storage Engines: MariaDB has 12 new storage engines.
  • Faster cache/indexes.
  • MariaDB offers Galera cluster technology.
  • Larger and Faster Connection Pool.
  • MariaDB comes with an advanced thread pool capable of running faster and supporting up to 200,000+ connections.
  • Improved Replication that can be done safer and faster.
  • New Features/Extensions: including the JSON, WITH and KILL statements.
  • MariaDB also offers many operations and commands and eliminates/replaces features impacting performance negatively.

Getting Started with MariaDB in the Cloud on Ubuntu

SSH into new server

Once your MariaDB server has been deployed, the following links explain how to connect to a Linux VM(Virtual Machine):

 

 

Once connected and logged in, the following section explains how to start using MariaDB. 

Using MariaDB on Ubuntu

To improve the security of MariaDB and change the root user password, remove the anonymous user, restrict root user access to the local machine. Run the following command:

				
					sudo mysql_secure_installation
				
			

MariaDB root login details are:

 

User: root

Pass: blank (no password set)

 

Next is to open the MySQL client shell with the following command:

				
					sudo mysql
				
			

Create MariaDB Database

Once your on the MySQL client shell, the following example code snippets will create a test database called mariadbcloud:

				
					CREATE DATABASE mariadbcloud;
				
			

To show a list of your created databases, run the following command:

				
					show databases;
				
			

Create New MariaDB User

To create a new user in MariaDB, We type the following command.  Simply replace mariadbuser with the name of the user you would like to create and replace the password123 with your chosen password.

				
					CREATE USER 'mariadbuser'@localhost IDENTIFIED BY 'password123';
				
			

Once you’ve created your new user, to check the status of the user, simply run the following command:

				
					SELECT User FROM mysql.user;
				
			

Grant Privileges to MariaDB User

Your newly created user does not have privileges to manage any MariaDB databases or to access the MariaDB shell.  So to grant all privileges to our new user, we run the following command:

				
					GRANT ALL PRIVILEGES ON *.* TO 'mariadbuser'@localhost IDENTIFIED BY 'password123';
				
			

The *.* in the statement refers to the database or table for which the user is given privileges. This specific command provides access to all databases located on the server. As this might be a major security issue, you should replace the symbol with the name of the database you are providing access to.  So in our database we would run the following command to only give permissions on our database.

				
					GRANT ALL PRIVILEGES ON 'mariadbcloud'.* TO 'mariadbuser'@localhost;
				
			

Then we need to refresh the privileges so it updates with the following command:

				
					FLUSH PRIVILEGES;
				
			

Documentation on using MariaDB can be found on the following link:

 

MariaDB Documentation:

https://mariadb.org/documentation/

MariaDB Firewall Ports

MariaDB is configured to use the following ports:

 

TCP 3306

 

To setup AWS firewall rules refer to – AWS Security Groups

To setup Azure firewall rules refer to – Azure Network Security Groups

To setup Google GCP firewall rules refer to – Creating GCP Firewalls

MariaDB Support

If you require any help with the installation of MariaDB, leave a comment below or contact us directly if you are experiencing any issues.

 

Disclaimer: MariaDB® is a registered trademark owned by MariaDB Corporation Ab, Inc and is licensed under GPL v2 license. No warrantee of any kind, express or implied, is included with this software. Use at your risk, responsibility for damages (if any) to anyone resulting from the use of this software rest entirely with the user. The author is not responsible for any damage that its use could cause.

Avatar for Andrew Fitzgerald
Andrew Fitzgerald

Cloud Solution Architect. Helping customers transform their business to the cloud. 20 years experience working in complex infrastructure environments and a Microsoft Certified Solutions Expert on everything Cloud.

0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x