How to Install MariaDB on Ubuntu 20.04
We hope this post helped you to find out How to Install MariaDB on Ubuntu 20.04
MariaDB is an open-source relational database administration system. It was initially designed as a backward-compatible, binary drop-in alternative of MySQL.
MariaDB is developed and maintained by the unique builders of MySQL and by the open-source group.
This information explains how you can set up and safe MariaDB on Ubuntu 20.04.
We’re assuming that you’ve got administrative entry to the Ubuntu server, both as root or a person with sudo permissions.
Installing in MariaDB on Ubuntu
On the time of writing this text, the most recent MariaDB model accessible in Ubuntu’s repositories is model 10.3. To put in it run the next instructions:
sudo apt update
sudo apt install mariadb-server
As soon as the set up is accomplished, the MariaDB service will begin robotically. To confirm that the database server is operating, sort:
sudo systemctl status mariadb
The output should show that the service is enabled and running:
Securing MariaDB #
MariaDB server bundle comes with a script named
mysql_secure_installation that lets you simply enhance the database server safety.
Execute the script with out arguments:
The script will prompt you to enter the root password:
Enter current password for root (enter for none):
Since you haven’t set the root password yet, just press “Enter” here.
On the next prompt, you will be asked to set a password for the MySQL root user:
Set root password? [Y/n] n
n. On Ubuntu, MariaDB root person is authenticated by the
auth_socket plugin by default. This plugin works by checking whether or not the native system person invoking the shopper program matches the required MariaDB person title.
Subsequent, you’ll be requested to take away the nameless person, limit root person entry to the native machine, take away the check database, and reload privilege tables. You must reply
Y to all the questions:
Remove anonymous users? [Y/n] Y Disallow root login remotely? [Y/n] Y Remove test database and access to it? [Y/n] Y Reload privilege tables now? [Y/n] Y
Login as root #
To work together with the MariaDB server from the command line, use the
mysql shopper utility or its alias
mariadb. This software is put in as a dependency of the MariaDB server bundle.
auth_socket plugin authenticates customers that join from the
localhost via the Unix socket file. This implies you can’t authenticate as root by offering a password.
To log in to the MariaDB server as the foundation person sort:
You will be presented with the MariaDB shell, as shown below:
Welcome to the MariaDB monitor. Commands end with ; or g. Your MariaDB connection id is 61 Server version: 10.3.22-MariaDB-1ubuntu1 Ubuntu 20.04 Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or 'h' for help. Type 'c' to clear the current input statement. MariaDB [(none)]> Bye
If you wish to login to your MariaDB server as root utilizing an exterior program akin to phpMyAdmin, you could have two choices.
The primary one is to alter the authentication methodology from
mysql_native_password. You are able to do that by operating the next command:
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'very_strong_password';
The second, recommended option is to create a new dedicated administrative user with access to all databases:
GRANT ALL PRIVILEGES ON *.* TO 'administrator'@'localhost' IDENTIFIED BY 'very_strong_password';
You may title the executive person something you need, however ensure you use a robust password.
We have now proven you how you can set up MariaDB on Ubuntu 20.04. Now that your database server is up and operating, the next move might be to learn to handle MariaDB person accounts and databases.
We hope the How to Install MariaDB on Ubuntu 20.04 help you. If you have any query regarding How to Install MariaDB on Ubuntu 20.04 drop a comment below and we will get back to you at the earliest.
We hope this post helped you to find out How to Install MariaDB on Ubuntu 20.04 . You may also want to see – How to Install Visual Studio Code on Ubuntu 20.04