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.
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):
- How to connect to a Linux VM on Azure
- How to connect to a Linux VM on AWS
- How to connect to a Linux VM on GCP
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:
MariaDB root login details are:
Pass: blank (no password set)
Next is to open the MySQL client shell with the following command:
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:
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:
MariaDB Firewall Ports
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.