Debian 10 mariadb

How To Install MariaDB on Debian 10

Switch Your VPS Hosting! Our SSD powered servers are both faster and cheaper than the competition, if not we'll match it!

Get Faster Hosting Today!

MariaDB is an open-source database management tool and is often installed as an alternative to MySQL since it has significant performance differences.

Step 1: Install MariaDB

To install the server:

sudo apt-get install mariadb-server

Enable it on restart:

sudo systemctl enable mysql.service

Start MariaDB:

sudo systemctl start mysql.service

Step 2: Configure MariaDB

To configure MariaDB:

sudo mysql_secure_installation

You will now be prompted with a configuration setup file. Please read through it and configure it to your liking. It is recommended to disable logins that are not from localhost.

  • Enter current password for root (enter for none): press Enter
  • Set root password? [Y/n]: Y
  • New password: Enter password
  • Re-enter new password: Repeat password
  • 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

Step 3: Create your Database

After this you may create your database, but first we need to login into MySQL:

sudo mysql -u root -p

You can create your database by running the following commands. We will call it database1 although you are free to call it whatever you want.


To create a new user:

CREATE USER 'database1'@'localhost' IDENTIFIED BY 'password_here';

To assign the user to the joomla database and give it all permisions:

GRANT ALL ON database1.* TO 'database1'@'localhost' IDENTIFIED BY 'password_here' WITH GRANT OPTION;

Remember to change password_here with your actual password.

Exit and flush for the changes to take affect:

0 0 vote
Article Rating

David Berndtsson

Retired member at HostUp and loves to write tutorials that actually work.

Need VPS Hosting? Give HostUp a go! Our SSD powered servers will give you a blazing fast experience. From $3.50 / month.

View Plans

Notify of
Inline Feedbacks
View all comments
Copy link